Open Closed

How to change userfriendlyexception statuscode #10493

langwen created

HI : How change userfriendlyexception statuscode to 200,or override userfriendlyexception ?


product version:10.3 product type:mvc framework core ABP Framework version:6.3

-Which theme are you using? Metronic

  • What are the theme settings?
  • Default

2 Answer(s)
  • 0
    musa.demir created
    Support Team

    Hi @langwen

    Here is the place that abp filter http result: You can override it to return 200 if exception is UserFriendlyException. It is an action filter. You can follow that documentation to get more info about it. You will need to remove our filter than implement your own filter. You may follow that code:

    var abpExceptionFilter = options.Filters.First(f => f is AbpExceptionFilter);
    var currentOrderOfFilter = options.Filters.IndexOf(abpExceptionFilter);
    options.Filters.AddService(typeof([YOUREXCEPTIONFILTER]), currentOrderOfFilter);
  • 0
    langwen created

    HI @musa.demir Thank you, according to your method, my functional requirements have been achieved