mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00

This prevents problems with different environments. Also introduces unit tests to double check HttpError values.
14 lines
473 B
TypeScript
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;
|
|
}
|
|
}
|