Open Closed

userfriendlyexception not working on index.cshtml page #4797


User avatar
0
Sraman created
  • ABP Framework version: v7.1.0
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace: { "error": { "code": null, "message": "Combination of Identification Number and Toolset Type already exists.", "details": null, "data": {}, "validationErrors": null } }
  • Steps to reproduce the issue: Facing above exception when throwing userfriendlyexception on index.cshtml page. But userfriendlyexception is working fine on create and edit pages.

5 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The framework can only handle pages with an object of the return type.

    https://docs.abp.io/en/abp/latest/Exception-Handling

  • User Avatar
    0
    Sraman created

    It is working fine on popup pages. Can you suggest a way to show the userfriendlyexception on index page from appservice without a return type?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    It is working fine on popup pages.

    This is because you are calling API, and the page cannot display such a style.

    You can check the Page-Alerts

    https://docs.abp.io/en/abp/latest/UI/AspNetCore/Page-Alerts

  • User Avatar
    0
    Sraman created

    Alert is not showing on appservice page.

    _alertManager.Alerts.Warning( text: L["ExpirationDateValidationMessage"], title: "Service Interruption" );

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can try catch the exception on your index page.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on May 20, 2025, 06:55