Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shorten the errors mentioning API parameters in BaseCMapReaderFactory and BaseStandardFontDataFactory #18502

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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