Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
show err msg
Browse files Browse the repository at this point in the history
  • Loading branch information
boypt committed Jul 14, 2021
1 parent ccc632e commit 8b11850
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion static/files/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
app.factory("reqerr", function ($rootScope) {
return function (xhr) {
if ("data" in xhr) {
$rootScope.err = `${xhr.statusText} - (${xhr.data})`
$rootScope.err = `${xhr.status} - ${xhr.statusText}`
if ("error" in xhr.data) {
$rootScope.err += ` :${xhr.data.error}`;
}
$log.error(xhr.data);
$rootScope.$applyAsync();
}
return xhr;
Expand Down

0 comments on commit 8b11850

Please sign in to comment.