Open Closed

Return a UserFriendlyException Error Message ta Web API client #9291

alwefaq created

I am currently using aspnetzero, and inside the solution, i have created an ASP .Net Core Web API. I created several API's that consumes the Application Services in the Web Application (ASPNetZero). The way i consume is through Http calls. My issues here is that if an AppService i am consuming throws a UserFriendlyException, its not returend, and i am always getting "Call failed with status code 500 (Internal Server Error)".

I tried using Postman, and when i call the AppService directly, it returns the frinedly error message, but if i make a call throgugh the Web API, it returns the same error "Call failed with status code 500 (Internal Server Error)". I tried in the startup, in the HostModule, to set the "Configuration.Modules.AbpWebCommon().SendAllExceptionsToClients = true", but this didn't solve the issue.

Can you point on how to be propagate business excpetions from the AppServices throught Web API's?

1 Answer(s)
  • 0
    ismcagdas created
    Support Team

    Hi @alwefaq

    Could you share;

    1. A sample app service defitinion
    2. The client code for calling those app service (which you get 500 error)