Skip to content
This repository was archived by the owner on Dec 5, 2023. It is now read-only.

Commit 088aa7d

Browse files
authored
Merge pull request #59 from microservices-demo/payment-error-feedback
Improve error reporting
2 parents 7a630af + 26bcb2f commit 088aa7d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

public/js/client.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,10 @@ function order() {
100100
}
101101
},
102102
error: function (jqXHR, textStatus, errorThrown) {
103-
console.log('error: ' + JSON.stringify(jqXHR));
104-
console.log('error: ' + textStatus);
105-
console.log('error: ' + errorThrown);
103+
response_payload = JSON.parse(jqXHR.responseText)
104+
console.log('error: ' + jqXHR.responseText);
106105
if (jqXHR.status == 406) {
107-
alert("Error placing order. Payment declined.");
106+
alert("Error placing order. " + response_payload.message);
108107
}
109108
}
110109
});

0 commit comments

Comments
 (0)