diff --git a/js/coinbin.js b/js/coinbin.js
index ba3d5a5..69f266d 100644
--- a/js/coinbin.js
+++ b/js/coinbin.js
@@ -1363,10 +1363,7 @@ $(document).ready(function() {
url: "https://api.blockcypher.com/v1/"+network+"/main/txs/push",
data: JSON.stringify({"tx":$("#rawTransaction").val()}),
error: function(data) {
- var obj = $.parseJSON(data.responseText);
- var r = ' ';
- r += (obj.error) ? obj.error : '';
- r = (r!='') ? r : ' Failed to broadcast'; // build response
+ var r = 'Failed to broadcast: error code=' + data.status.toString() + ' ' + data.statusText;
$("#rawTransactionStatus").addClass('alert-danger').removeClass('alert-success').removeClass("hidden").html(r).prepend('');
},
success: function(data) {
@@ -1393,10 +1390,7 @@ $(document).ready(function() {
data: {"data":$("#rawTransaction").val()},
dataType: "json",
error: function(data) {
- var obj = $.parseJSON(data.responseText);
- var r = ' ';
- r += (obj.data.tx_hex) ? ' '+obj.data.tx_hex : '';
- r = (r!='') ? r : ' Failed to broadcast'; // build response
+ var r = 'Failed to broadcast: error code=' + data.status.toString() + ' ' + data.statusText;
$("#rawTransactionStatus").addClass('alert-danger').removeClass('alert-success').removeClass("hidden").html(r).prepend('');
// console.error(JSON.stringify(data, null, 4));
},