最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - AngularJS doesn't show specific errors in the Firebug console anymore - Stack Overflow

programmeradmin1浏览0评论

I am using AngularJS along with the angular-material library in my application. The problem is, whenever any error occurs in any function of the controller, it doesn't show the specific error but instead shows the same generic error everytime, by looking at which you cannot determine what went wrong.

Here is the error shown in my console.

TypeError: href is null   stackFrame.js (line 357)
consoleLog/<()   angular.js (line 12416)
$ExceptionHandlerProvider/this.$get</<()   angular.js (line 9203)
processQueue()   angular.js (line 14642)
scheduleProcessQueue/<()   angular.js (line 14650)
$RootScopeProvider/this.$get</Scope.prototype.$eval()   angular.js (line 15878)
$RootScopeProvider/this.$get</Scope.prototype.$digest()   angular.js (line 15689)
$RootScopeProvider/this.$get</Scope.prototype.$apply()   angular.js (line 15986)
done()   angular.js (line 10511)
pleteRequest()   angular.js (line 10683)
requestLoaded()   angular.js (line 10624)

Here is the screenshot of that error.

PS: I am using the RequireJS JavaScript library to lazy-load my application. I am also using ui.router in my application.

Update 1: stackFrame.js is not a JavaScript file of my application. The location of stackFrame.js is:

chrome://firebug/content/debugger/stack/stackFrame.js

And it always shows the same error on the same line throughout my application in any controller, even if I face different errors in the application.

Update 2:

Disabling Firebug works. It shows the specific error in Firefox´ and Chrome´s console. I would like to add, that this type of error is shown in Firebug when there is an error inside the response function of $http.post(). Testing further cases.

Update 3:

With reference to , this issue has been solved in firebug 2.0.13.

I am using AngularJS along with the angular-material library in my application. The problem is, whenever any error occurs in any function of the controller, it doesn't show the specific error but instead shows the same generic error everytime, by looking at which you cannot determine what went wrong.

Here is the error shown in my console.

TypeError: href is null   stackFrame.js (line 357)
consoleLog/<()   angular.js (line 12416)
$ExceptionHandlerProvider/this.$get</<()   angular.js (line 9203)
processQueue()   angular.js (line 14642)
scheduleProcessQueue/<()   angular.js (line 14650)
$RootScopeProvider/this.$get</Scope.prototype.$eval()   angular.js (line 15878)
$RootScopeProvider/this.$get</Scope.prototype.$digest()   angular.js (line 15689)
$RootScopeProvider/this.$get</Scope.prototype.$apply()   angular.js (line 15986)
done()   angular.js (line 10511)
pleteRequest()   angular.js (line 10683)
requestLoaded()   angular.js (line 10624)

Here is the screenshot of that error.

PS: I am using the RequireJS JavaScript library to lazy-load my application. I am also using ui.router in my application.

Update 1: stackFrame.js is not a JavaScript file of my application. The location of stackFrame.js is:

chrome://firebug/content/debugger/stack/stackFrame.js

And it always shows the same error on the same line throughout my application in any controller, even if I face different errors in the application.

Update 2:

Disabling Firebug works. It shows the specific error in Firefox´ and Chrome´s console. I would like to add, that this type of error is shown in Firebug when there is an error inside the response function of $http.post(). Testing further cases.

Update 3:

With reference to https://github./firebug/firebug/issues/7948, this issue has been solved in firebug 2.0.13.

Share Improve this question edited Oct 30, 2015 at 8:08 Mohit Adwani asked Sep 29, 2015 at 5:08 Mohit AdwaniMohit Adwani 5193 silver badges13 bronze badges 12
  • Error shows what went wrong: stackFrame.js, line 357, href is null, Type error. It doesn't help you? – dfsq Commented Sep 29, 2015 at 5:12
  • stackFrame.js isn't a js file of my application. Please see the update. – Mohit Adwani Commented Sep 29, 2015 at 5:20
  • @MohitAdwani: did you try disabling firebug? – Shivangi Commented Sep 29, 2015 at 5:25
  • Oh, sure. Just get rid of Firebug, use built-in dev tools. – dfsq Commented Sep 29, 2015 at 5:26
  • @Shivi Disabling firebug works. The normal console of firefox shows the specific error. But i need firebug for development purposes. – Mohit Adwani Commented Sep 29, 2015 at 5:40
 |  Show 7 more ments

2 Answers 2

Reset to default 5

This is obviously a bug in Firebug. The related line within its code is this one:

https://github./firebug/firebug/blob/a389cf78b310aedf33531520cc11f1e05051ecc3/extension/content/firebug/debugger/stack/stackFrame.js#L357

If you want this to get fixed, you should file a bug report for Firebug.

You can use custom exception handling in AngularJs.

app.config(function($provide){

    $provide.decorator("$exceptionHandler", function($delegate, $injector){
        return function(exception, cause){
            var $rootScope = $injector.get("$rootScope");
            $rootScope.addError({message:"Exception", reason:exception});
            $delegate(exception, cause);
        };
    });

});

It will send all errors to $rootScope for data binding before allowing the call to fall through to the default implementation (addError is a custom method on $rootScope, while $delegate represents the service being decorated).

errors service to encapsulate some of the mon logic.

app.factory("errors", function($rootScope){
    return {
        catch: function(message){
            return function(reason){
                $rootScope.addError({message: message, reason: reason})
            };
        }
    };
});

Handling Error:

 TestService.doWork().then()               
        .catch(errors.catch("Could not plete work!"));
发布评论

评论列表(0)

  1. 暂无评论