JavaScript generic ASN.1 parser (mirror)
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Improve exceptions.

+3 -2
+3 -2
asn1.js
··· 417 417 while (stream.pos < end) 418 418 sub[sub.length] = ASN1.decode(stream); 419 419 if (stream.pos != end) 420 - throw "Content size is not correct for container starting at offset " + start; 420 + throw 'Content size is not correct for container at offset ' + start; 421 421 } else { 422 422 // undefined length 423 423 try { ··· 429 429 } 430 430 len = start - stream.pos; // undefined lengths are represented as negative values 431 431 } catch (e) { 432 - throw "Exception while decoding undefined length content: " + e; 432 + throw 'Exception while decoding undefined length content at offset ' + start + ': ' + e; 433 433 } 434 434 } 435 435 }; ··· 449 449 } catch (e) { 450 450 // but silently ignore when they don't 451 451 sub = null; 452 + //DEBUG console.log('Could not decode structure at ' + start + ':', e); 452 453 } 453 454 } 454 455 if (sub === null) {