Better error message output
This commit is contained in:
parent
6d0b6b0642
commit
b547be44b2
|
@ -27,10 +27,16 @@ var ApplicationRoute = Discourse.Route.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
var exceptionController = this.controllerFor('exception'),
|
var exceptionController = this.controllerFor('exception'),
|
||||||
errorString = err.toString();
|
errorString = err.toString(),
|
||||||
if (err.statusText) {
|
stack = err.stack;
|
||||||
errorString = err.statusText;
|
|
||||||
}
|
// If we have a stack call `toString` on it. It gives us a better
|
||||||
|
// stack trace since `console.error` uses the stack track of this
|
||||||
|
// error callback rather than the original error.
|
||||||
|
if (stack) { errorString = stack.toString(); }
|
||||||
|
|
||||||
|
if (err.statusText) { errorString = err.statusText; }
|
||||||
|
|
||||||
var c = window.console;
|
var c = window.console;
|
||||||
if (c && c.error) {
|
if (c && c.error) {
|
||||||
c.error(errorString);
|
c.error(errorString);
|
||||||
|
|
Loading…
Reference in New Issue