1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 09:38:06 +02:00

Improve the error handling when loading of built-in CMap files fail (PR 8064 follow-up)

I happened to notice that the error handling wasn't that great, which I missed previously since there were no unit-tests for failure to load built-in CMap files.
Hence this patch, which improves the error handling *and* adds tests.
This commit is contained in:
Jonas Jenwald 2017-03-28 12:08:44 +02:00
parent 07f7c97b2b
commit 437104969d
3 changed files with 48 additions and 6 deletions

View file

@ -954,7 +954,7 @@ var CMapFactory = (function CMapFactoryClosure() {
return Promise.resolve(new IdentityCMap(true, 2));
}
if (BUILT_IN_CMAPS.indexOf(name) === -1) {
return Promise.reject(new Error('Unknown cMap name: ' + name));
return Promise.reject(new Error('Unknown CMap name: ' + name));
}
assert(fetchBuiltInCMap, 'Built-in CMap parameters are not provided.');