Comparing version 2.1.2 to 2.1.3
@@ -0,1 +1,5 @@ | ||
## 2.1.3 (2019-07-29) | ||
- catch uncaught errors in keybase/packet#alloc | ||
## 2.1.2 (2019-05-13) | ||
@@ -2,0 +6,0 @@ |
// Generated by IcedCoffeeScript 108.0.11 | ||
(function() { | ||
var Encryption, K, P3SKB, Signature; | ||
var Encryption, K, P3SKB, Signature, katch; | ||
@@ -13,28 +13,43 @@ K = require('../../const').kb; | ||
katch = function(f) { | ||
var e; | ||
try { | ||
return [null, f()]; | ||
} catch (_error) { | ||
e = _error; | ||
return [e, null]; | ||
} | ||
}; | ||
exports.alloc = function(_arg) { | ||
var body, err, ret, tag; | ||
var body, err, ret, tag, _ref; | ||
tag = _arg.tag, body = _arg.body; | ||
ret = err = null; | ||
ret = (function() { | ||
_ref = (function() { | ||
switch (tag) { | ||
case K.packet_tags.p3skb: | ||
return P3SKB.alloc({ | ||
tag: tag, | ||
body: body | ||
return katch(function() { | ||
return P3SKB.alloc({ | ||
tag: tag, | ||
body: body | ||
}); | ||
}); | ||
case K.packet_tags.signature: | ||
return Signature.alloc({ | ||
tag: tag, | ||
body: body | ||
return katch(function() { | ||
return Signature.alloc({ | ||
tag: tag, | ||
body: body | ||
}); | ||
}); | ||
case K.packet_tags.encryption: | ||
return Encryption.alloc({ | ||
tag: tag, | ||
body: body | ||
return katch(function() { | ||
return Encryption.alloc({ | ||
tag: tag, | ||
body: body | ||
}); | ||
}); | ||
default: | ||
err = new Error("unknown packet tag: " + tag); | ||
return null; | ||
return [err, null]; | ||
} | ||
})(); | ||
})(), err = _ref[0], ret = _ref[1]; | ||
return [err, ret]; | ||
@@ -41,0 +56,0 @@ }; |
@@ -10,3 +10,3 @@ { | ||
"author": "Maxwell Krohn", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"license": "BSD-3-Clause", | ||
@@ -13,0 +13,0 @@ "main": "./lib/main.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1257527
18502