mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: Add missing error causes
This commit is contained in:
@@ -32,7 +32,7 @@ export class N3PatchBodyParser extends BodyParser {
|
||||
try {
|
||||
store = new Store(parser.parse(n3));
|
||||
} catch (error: unknown) {
|
||||
throw new BadRequestHttpError(`Invalid N3: ${createErrorMessage(error)}`);
|
||||
throw new BadRequestHttpError(`Invalid N3: ${createErrorMessage(error)}`, { cause: error });
|
||||
}
|
||||
|
||||
// Solid, §5.3.1: "A patch resource MUST contain a triple ?patch rdf:type solid:InsertDeletePatch."
|
||||
|
||||
@@ -100,7 +100,8 @@ export class NotificationSubscriber extends OperationHttpHandler {
|
||||
});
|
||||
channel = await this.channelType.initChannel(await readableToQuads(quadStream.data), credentials);
|
||||
} catch (error: unknown) {
|
||||
throw new UnprocessableEntityHttpError(`Unable to process notification channel: ${createErrorMessage(error)}`);
|
||||
throw new UnprocessableEntityHttpError(`Unable to process notification channel: ${createErrorMessage(error)}`,
|
||||
{ cause: error });
|
||||
}
|
||||
|
||||
if (this.maxDuration) {
|
||||
|
||||
@@ -25,7 +25,8 @@ export async function fetchDataset(url: string): Promise<Representation> {
|
||||
const quadArray = await arrayifyStream<Quad>(quadStream);
|
||||
return new BasicRepresentation(quadArray, { path: url }, INTERNAL_QUADS, false);
|
||||
} catch (error: unknown) {
|
||||
throw new BadRequestHttpError(`Could not parse resource at URL (${url})! ${createErrorMessage(error)}`);
|
||||
throw new BadRequestHttpError(`Could not parse resource at URL (${url})! ${createErrorMessage(error)}`,
|
||||
{ cause: error });
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
||||
@@ -112,7 +112,8 @@ export class FileSystemResourceLocker implements ResourceLocker, Initializable,
|
||||
this.attemptSettings,
|
||||
);
|
||||
} catch (err: unknown) {
|
||||
throw new InternalServerError(`Error trying to acquire lock for ${path}. ${createErrorMessage(err)}`);
|
||||
throw new InternalServerError(`Error trying to acquire lock for ${path}. ${createErrorMessage(err)}`,
|
||||
{ cause: err });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,7 +127,8 @@ export class FileSystemResourceLocker implements ResourceLocker, Initializable,
|
||||
this.attemptSettings,
|
||||
);
|
||||
} catch (err: unknown) {
|
||||
throw new InternalServerError(`Error trying to release lock for ${path}. ${createErrorMessage(err)}`);
|
||||
throw new InternalServerError(`Error trying to release lock for ${path}. ${createErrorMessage(err)}`,
|
||||
{ cause: err });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user