mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-31 00:16:47 +01:00
feb6825023
## About the changes
We don't have a meaningful error for limits established by the
application. This could be a good starting point.
The error code is 400 cause I couldn't find anything better.
The name of the error was picked from UnleashApiErrorTypes:
2d8e9f87ff/src/lib/error/unleash-error.ts (L4-L34)
12 lines
388 B
TypeScript
12 lines
388 B
TypeScript
import { GenericUnleashError } from './unleash-error';
|
|
|
|
export class ExceedsLimitError extends GenericUnleashError {
|
|
constructor(resource: string, limit: number) {
|
|
super({
|
|
name: 'ExceedsLimitError',
|
|
message: `Failed to create ${resource}. You can't create more than the established limit of ${limit}.`,
|
|
statusCode: 400,
|
|
});
|
|
}
|
|
}
|