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:
commit
0ed4521ad5
@ -111,8 +111,7 @@ class BaseCMapReaderFactory {
|
|||||||
async fetch({ name }) {
|
async fetch({ name }) {
|
||||||
if (!this.baseUrl) {
|
if (!this.baseUrl) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'The CMap "baseUrl" parameter must be specified, ensure that ' +
|
"Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided."
|
||||||
'the "cMapUrl" and "cMapPacked" API parameters are provided.'
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!name) {
|
if (!name) {
|
||||||
@ -149,8 +148,7 @@ class BaseStandardFontDataFactory {
|
|||||||
async fetch({ filename }) {
|
async fetch({ filename }) {
|
||||||
if (!this.baseUrl) {
|
if (!this.baseUrl) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'The standard font "baseUrl" parameter must be specified, ensure that ' +
|
"Ensure that the `standardFontDataUrl` API parameter is provided."
|
||||||
'the "standardFontDataUrl" API parameter is provided.'
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!filename) {
|
if (!filename) {
|
||||||
|
|||||||
@ -222,8 +222,7 @@ describe("cmap", function () {
|
|||||||
} catch (reason) {
|
} catch (reason) {
|
||||||
expect(reason instanceof Error).toEqual(true);
|
expect(reason instanceof Error).toEqual(true);
|
||||||
expect(reason.message).toEqual(
|
expect(reason.message).toEqual(
|
||||||
'The CMap "baseUrl" parameter must be specified, ensure that ' +
|
"Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided."
|
||||||
'the "cMapUrl" and "cMapPacked" API parameters are provided.'
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user