Proto-loading: Throw if we get an error
This commit is contained in:
parent
fd7372e67e
commit
c8013d930c
1 changed files with 3 additions and 0 deletions
|
@ -5,6 +5,9 @@
|
||||||
|
|
||||||
function loadProtoBufs(filename) {
|
function loadProtoBufs(filename) {
|
||||||
return dcodeIO.ProtoBuf.loadProtoFile({root: 'protos', file: filename}, function(error, result) {
|
return dcodeIO.ProtoBuf.loadProtoFile({root: 'protos', file: filename}, function(error, result) {
|
||||||
|
if (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
var protos = result.build('textsecure');
|
var protos = result.build('textsecure');
|
||||||
for (var protoName in protos) {
|
for (var protoName in protos) {
|
||||||
textsecure.protobuf[protoName] = protos[protoName];
|
textsecure.protobuf[protoName] = protos[protoName];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue