Skip to content

Commit

Permalink
Made init function have error handling
Browse files Browse the repository at this point in the history
Fixing #118
  • Loading branch information
lindell committed Dec 21, 2016
1 parent 89d4663 commit 2aa39dc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/JsBarcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ API.prototype.init = function(){
options.format = autoSelectBarcode();
}

var text = options.value;
this._errorHandler.wrapBarcodeCall(function(){
var text = options.value;
var Encoder = barcodes[options.format.toUpperCase()];
var encoded = encode(text, Encoder, options);

var Encoder = barcodes[options.format.toUpperCase()];

var encoded = encode(text, Encoder, options);

render(renderProperty, encoded, options);
render(renderProperty, encoded, options);
});
}
};

Expand Down

0 comments on commit 2aa39dc

Please sign in to comment.