Add onerror handler to Worker to see uncaught errors
This commit is contained in:
parent
6bb53f04b4
commit
3604f19eb9
|
@ -41,6 +41,9 @@ var INITIAL_RANDOM_SEED = 50000, // random bytes seeded to worker
|
||||||
function AsyncProxy(path) {
|
function AsyncProxy(path) {
|
||||||
this.worker = new Worker(path || 'openpgp.worker.js');
|
this.worker = new Worker(path || 'openpgp.worker.js');
|
||||||
this.worker.onmessage = this.onMessage.bind(this);
|
this.worker.onmessage = this.onMessage.bind(this);
|
||||||
|
this.worker.onerror = function(e) {
|
||||||
|
throw new Error('Unhandled error in openpgp worker: ' + e.message + ' (' + e.filename + ':' + e.lineno + ')');
|
||||||
|
};
|
||||||
this.seedRandom(INITIAL_RANDOM_SEED);
|
this.seedRandom(INITIAL_RANDOM_SEED);
|
||||||
// FIFO
|
// FIFO
|
||||||
this.tasks = [];
|
this.tasks = [];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user