mirror of
https://github.com/directus/directus.git
synced 2026-01-24 16:07:59 -05:00
Add extensions support to hit rate limit exception
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
import { BaseException } from './base';
|
||||
|
||||
type Extensions = {
|
||||
limit: number;
|
||||
reset: Date;
|
||||
}
|
||||
|
||||
export class HitRateLimitException extends BaseException {
|
||||
constructor(message: string) {
|
||||
super(message, 429, 'REQUESTS_EXCEEDED');
|
||||
constructor(message: string, extensions: Extensions) {
|
||||
super(message, 429, 'REQUESTS_EXCEEDED', extensions);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user