Skip to content

Commit

Permalink
Merge pull request #18502 from Snuffleupagus/base_factory-shorter-errors
Browse files Browse the repository at this point in the history
Shorten the errors mentioning API parameters in `BaseCMapReaderFactory` and `BaseStandardFontDataFactory`
  • Loading branch information
timvandermeij authored Jul 27, 2024
2 parents 8378c40 + d116ab1 commit 0ed4521
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/display/base_factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 1 addition & 2 deletions test/unit/cmap_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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."
);
}
});
Expand Down

0 comments on commit 0ed4521

Please sign in to comment.