This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
var jsonErrorInterceptor = function($q) { | |
return function(promise) { | |
// error handler | |
var triggerError = function(message) { | |
if (message instanceof Array) { | |
message = message[0]; | |
} | |
console.log(message); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getStackTrace = function() { | |
if (typeof Error.captureStackTrace == 'undefined') { | |
return []; | |
} | |
var obj = {}; | |
Error.captureStackTrace(obj, getStackTrace); | |
var trace = obj.stack.split("\n"); | |
trace.splice(0, 2); |