Base solution for your next web application
Open Closed

turn off abp login error alerts #220


User avatar
0
lminmei created

Is it possible to turn off the "UserFriendlyExceptions" on login errors? I want to be able to use Angular to process these errors on the login.js page


3 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    You can override abp.ng.http.showError in javascript like that:

    abp.ng.http.showError = function(error) { 
    //Show error or do another thing...
     }
    
  • User Avatar
    0
    lminmei created

    which js file would I place that code at? when there is a login error (which is handled by the ASP.NET AccountController.cs), the AccountController will throw the new UserFriendlyException("login error") and which a js alert is activated before the error event handler in the login.js file. so i'm not sure where to put that block of code to override the default abp error handler.

  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    You can add the code after including abp.ng.js script to your page. Just create a new script file and write it there.