mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
* InvalidPDFException added
* Act on throwing an Exception and InvalidPDFException by rejecting the worker instead of throwing * changed message for all builds * alerting and closing window only for B2G builds * invalid_file_error added to l10n (en and pl) * UnknownErrorException added and used for every error()
This commit is contained in:
parent
336d5041dd
commit
812bc6795d
7 changed files with 62 additions and 5 deletions
25
src/util.js
25
src/util.js
|
@ -148,6 +148,31 @@ var PasswordException = (function PasswordExceptionClosure() {
|
|||
return PasswordException;
|
||||
})();
|
||||
|
||||
var UnknownErrorException = (function UnknownErrorExceptionClosure() {
|
||||
function UnknownErrorException(msg, details) {
|
||||
this.name = 'UnknownErrorException';
|
||||
this.message = msg;
|
||||
this.details = details;
|
||||
}
|
||||
|
||||
UnknownErrorException.prototype = new Error();
|
||||
UnknownErrorException.constructor = UnknownErrorException;
|
||||
|
||||
return UnknownErrorException;
|
||||
})();
|
||||
|
||||
var InvalidPDFException = (function InvalidPDFExceptionClosure() {
|
||||
function InvalidPDFException(msg) {
|
||||
this.name = 'InvalidPDFException';
|
||||
this.message = msg;
|
||||
}
|
||||
|
||||
InvalidPDFException.prototype = new Error();
|
||||
InvalidPDFException.constructor = InvalidPDFException;
|
||||
|
||||
return InvalidPDFException;
|
||||
})();
|
||||
|
||||
function bytesToString(bytes) {
|
||||
var str = '';
|
||||
var length = bytes.length;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue