Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

UserFriendlyException returns 500 Internal Server Error. #1599


User avatar
0
eggersa created

Suddenly, my application started to return 500 Internal Server Error if a UserFriendlyException is thrown. For example when the user tries to log in with wrong credentials. Since the the handling of this error (mapping it to a user friendly exception that is shown on the client side) happens inside the aspnetboilerplate dlls I have almost no chance to figure out why. I am now looking for some checkpoints that could cause this behavior? I am using version 0.8.4. Thank you for your help.

Edit:

The only thing I get from the output window is: Exception thrown: 'Abp.UI.UserFriendlyException' in MyApplication.Web.dll Exception thrown: 'Abp.UI.UserFriendlyException' in mscorlib.dll

Also the exception event is not fired (IEventHandler<AbpHandledExceptionData>).


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

    Hi,

    Can you check the value of customErrors in web config ?

  • User Avatar
    0
    eggersa created

    The value is set to RemoteOnly:

    <customErrors mode="RemoteOnly">
          <error statusCode="404" redirect="~/Error/E404" />
        </customErrors>
    

    Edit:

    I just retestet the application and now it works. I probably had set mode="Off" when I last tested the application. However, I am wondering what exactly is the relation between the customErrors mode and this behavior?

  • User Avatar
    0
    ismcagdas created
    Support Team

    When the customErrors mode is Off, ABP does not handle exceptions. Because of that, you cannot see the exception detials.

    If you want to have a detailed information you can take a look at ABP's exception handling documentation <a class="postlink" href="http://aspnetboilerplate.com/Pages/Documents/Handling-Exceptions">http://aspnetboilerplate.com/Pages/Docu ... Exceptions</a>.