mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
feat: Add metadata to errors
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { TLSSocket } from 'tls';
|
||||
import type { HttpRequest } from '../../../server/HttpRequest';
|
||||
import { BadRequestHttpError } from '../../../util/errors/BadRequestHttpError';
|
||||
import { errorTermsToMetadata } from '../../../util/errors/HttpErrorUtil';
|
||||
import { InternalServerError } from '../../../util/errors/InternalServerError';
|
||||
import { parseForwarded } from '../../../util/HeaderUtil';
|
||||
import type { IdentifierStrategy } from '../../../util/identifiers/IdentifierStrategy';
|
||||
@@ -73,7 +74,7 @@ export class OriginalUrlExtractor extends TargetExtractor {
|
||||
// Check if the configured IdentifierStrategy supports the identifier
|
||||
if (!this.identifierStrategy.supportsIdentifier(identifier)) {
|
||||
throw new InternalServerError(`The identifier ${identifier.path} is outside the configured identifier space.`,
|
||||
{ errorCode: 'E0001', details: { path: identifier.path }});
|
||||
{ errorCode: 'E0001', metadata: errorTermsToMetadata({ path: identifier.path }) });
|
||||
}
|
||||
|
||||
return identifier;
|
||||
|
||||
Reference in New Issue
Block a user