mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: Rename UnsupportedHttpError into BadRequestError.
This commit is contained in:
committed by
Joachim Van Herwegen
parent
03ffaaed43
commit
af8f1976cd
@@ -1,6 +1,7 @@
|
||||
import type { Representation } from '../../ldp/representation/Representation';
|
||||
import type { ResourceIdentifier } from '../../ldp/representation/ResourceIdentifier';
|
||||
import { UnsupportedHttpError } from '../../util/errors/UnsupportedHttpError';
|
||||
import { BadRequestHttpError } from '../../util/errors/BadRequestHttpError';
|
||||
import { NotImplementedHttpError } from '../../util/errors/NotImplementedHttpError';
|
||||
import { trimTrailingSlashes } from '../../util/PathUtil';
|
||||
import type { ResourceStore } from '../ResourceStore';
|
||||
import { RouterRule } from './RouterRule';
|
||||
@@ -47,7 +48,7 @@ export class RegexRouterRule extends RouterRule {
|
||||
return this.regexes.get(regex)!;
|
||||
}
|
||||
}
|
||||
throw new UnsupportedHttpError(`No stored regexes match ${identifier.path}`);
|
||||
throw new NotImplementedHttpError(`No stored regexes match ${identifier.path}`);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -55,7 +56,7 @@ export class RegexRouterRule extends RouterRule {
|
||||
*/
|
||||
private toRelative(identifier: ResourceIdentifier): string {
|
||||
if (!identifier.path.startsWith(this.base)) {
|
||||
throw new UnsupportedHttpError(`Identifiers need to start with ${this.base}`);
|
||||
throw new BadRequestHttpError(`Identifiers need to start with ${this.base}`);
|
||||
}
|
||||
return identifier.path.slice(this.base.length);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user