1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Merge pull request #18502 from Snuffleupagus/base_factory-shorter-errors

Shorten the errors mentioning API parameters in `BaseCMapReaderFactory` and `BaseStandardFontDataFactory`
This commit is contained in:
Tim van der Meij 2024-07-27 20:48:39 +02:00 committed by GitHub
commit 0ed4521ad5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 6 deletions

View file

@ -111,8 +111,7 @@ class BaseCMapReaderFactory {
async fetch({ name }) {
if (!this.baseUrl) {
throw new Error(
'The CMap "baseUrl" parameter must be specified, ensure that ' +
'the "cMapUrl" and "cMapPacked" API parameters are provided.'
"Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided."
);
}
if (!name) {
@ -149,8 +148,7 @@ class BaseStandardFontDataFactory {
async fetch({ filename }) {
if (!this.baseUrl) {
throw new Error(
'The standard font "baseUrl" parameter must be specified, ensure that ' +
'the "standardFontDataUrl" API parameter is provided.'
"Ensure that the `standardFontDataUrl` API parameter is provided."
);
}
if (!filename) {

View file

@ -222,8 +222,7 @@ describe("cmap", function () {
} catch (reason) {
expect(reason instanceof Error).toEqual(true);
expect(reason.message).toEqual(
'The CMap "baseUrl" parameter must be specified, ensure that ' +
'the "cMapUrl" and "cMapPacked" API parameters are provided.'
"Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided."
);
}
});