Protobufs: More logging on failure to load protobufs, fix tests

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-08-08 11:17:03 -07:00
parent ff1cb3598d
commit 0fbe43c2dc
No known key found for this signature in database
GPG key ID: A4931C09644C654B
3 changed files with 8 additions and 1 deletions

View file

@ -37097,11 +37097,15 @@ Internal.SessionLock.queueJobForNumber = function queueJobForNumber(number, runJ
function loadProtoBufs(filename) {
return dcodeIO.ProtoBuf.loadProtoFile({root: window.PROTO_ROOT, file: filename}, function(error, result) {
if (error) {
var text = 'Error loading protos from ' + filename + ' (root: ' + window.PROTO_ROOT + ') '
+ (error && error.stack ? error.stack : error);
console.log(text);
throw error;
}
var protos = result.build('textsecure');
if (!protos) {
var text = 'Error loading protos from ' + filename + ' (root: ' + window.PROTO_ROOT + ')';
console.log(text);
throw new Error(text);
}
for (var protoName in protos) {