fix: Rename UnsupportedHttpError into BadRequestError.

This commit is contained in:
Ruben Verborgh
2020-11-27 10:25:05 +01:00
committed by Joachim Van Herwegen
parent 03ffaaed43
commit af8f1976cd
53 changed files with 177 additions and 171 deletions

View File

@@ -1,7 +1,7 @@
import type { Operation } from '../../../../src/ldp/operations/Operation';
import { PatchOperationHandler } from '../../../../src/ldp/operations/PatchOperationHandler';
import type { ResourceStore } from '../../../../src/storage/ResourceStore';
import { UnsupportedHttpError } from '../../../../src/util/errors/UnsupportedHttpError';
import { NotImplementedHttpError } from '../../../../src/util/errors/NotImplementedHttpError';
describe('A PatchOperationHandler', (): void => {
const store = {} as unknown as ResourceStore;
@@ -12,7 +12,7 @@ describe('A PatchOperationHandler', (): void => {
it('only supports PATCH operations.', async(): Promise<void> => {
await expect(handler.canHandle({ method: 'PATCH' } as Operation)).resolves.toBeUndefined();
await expect(handler.canHandle({ method: 'GET' } as Operation)).rejects.toThrow(UnsupportedHttpError);
await expect(handler.canHandle({ method: 'GET' } as Operation)).rejects.toThrow(NotImplementedHttpError);
});
it('deletes the resource from the store and returns the correct response.', async(): Promise<void> => {