fix: Add missing error causes

This commit is contained in:
Joachim Van Herwegen
2023-07-25 14:24:45 +02:00
parent f373dff1d7
commit 7505f07f2f
4 changed files with 9 additions and 5 deletions

View File

@@ -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 });
}
})();
}