1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Change throws to errors.

This commit is contained in:
Kalervo Kujala 2012-01-24 22:04:59 +02:00
parent 67769f3741
commit 66e3441e0e
7 changed files with 42 additions and 38 deletions

View file

@ -26,7 +26,7 @@ function MessageHandler(name, comObj) {
delete callbacks[callbackId];
callback(data.data);
} else {
throw 'Cannot resolve callback ' + callbackId;
error('Cannot resolve callback ' + callbackId);
}
} else if (data.action in ah) {
var action = ah[data.action];
@ -44,7 +44,7 @@ function MessageHandler(name, comObj) {
action[0].call(action[1], data.data);
}
} else {
throw 'Unkown action from worker: ' + data.action;
error('Unkown action from worker: ' + data.action);
}
};
}
@ -53,7 +53,7 @@ MessageHandler.prototype = {
on: function messageHandlerOn(actionName, handler, scope) {
var ah = this.actionHandler;
if (ah[actionName]) {
throw 'There is already an actionName called "' + actionName + '"';
error('There is already an actionName called "' + actionName + '"');
}
ah[actionName] = [handler, scope];
},
@ -217,7 +217,7 @@ var workerConsole = {
timeEnd: function timeEnd(name) {
var time = consoleTimer[name];
if (time == null) {
throw 'Unkown timer name ' + name;
error('Unkown timer name ' + name);
}
this.log('Timer:', name, Date.now() - time);
}