CommunitySolidServer/src/util/errors/MethodNotAllowedHttpError.ts
Joachim Van Herwegen e752927171 fix: Remove all instanceof checks
This prevents problems with different environments.
Also introduces unit tests to double check HttpError values.
2021-01-25 16:11:43 +01:00

14 lines
473 B
TypeScript

import { HttpError } from './HttpError';
/**
* An error thrown when data was found for the requested identifier, but is not supported by the target resource.
*/
export class MethodNotAllowedHttpError extends HttpError {
public constructor(message?: string) {
super(405, 'MethodNotAllowedHttpError', message);
}
public static isInstance(error: any): error is MethodNotAllowedHttpError {
return HttpError.isInstance(error) && error.statusCode === 405;
}
}