Merge branch 'main' into versions/5.0.0

This commit is contained in:
Joachim Van Herwegen
2022-05-24 10:40:27 +02:00
21 changed files with 2600 additions and 680 deletions

View File

@@ -8,6 +8,7 @@ import { getLoggerFor } from '../logging/LogUtil';
import type { RepresentationConverter } from '../storage/conversion/RepresentationConverter';
import { INTERNAL_QUADS } from './ContentTypes';
import { BadRequestHttpError } from './errors/BadRequestHttpError';
import { createErrorMessage } from './errors/ErrorUtil';
const logger = getLoggerFor('FetchUtil');
@@ -23,8 +24,8 @@ export async function fetchDataset(url: string): Promise<Representation> {
const quadStream = (await rdfDereferencer.dereference(url)).data;
const quadArray = await arrayifyStream<Quad>(quadStream);
return new BasicRepresentation(quadArray, { path: url }, INTERNAL_QUADS, false);
} catch {
throw new BadRequestHttpError(`Could not parse resource at URL (${url})!`);
} catch (error: unknown) {
throw new BadRequestHttpError(`Could not parse resource at URL (${url})! ${createErrorMessage(error)}`);
}
})();
}