Fix error handling

This commit is contained in:
Tankred Hase 2016-05-24 17:16:54 +02:00
parent 4fd9fd3c7f
commit 87b4bfefd8

View File

@ -77,7 +77,8 @@ function seedRandom(buffer) {
*/ */
function delegate(method, options) { function delegate(method, options) {
if (typeof openpgp[method] !== 'function') { if (typeof openpgp[method] !== 'function') {
throw new Error('Unknown Worker Event'); response({ event:'method-return', err:'Unknown Worker Event' });
return;
} }
// parse cloned packets // parse cloned packets
options = openpgp.packet.clone.parseClonedPackets(options, method); options = openpgp.packet.clone.parseClonedPackets(options, method);