Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • David Jazbec 23 posts 145 karma points
    Aug 15, 2024 @ 20:29
    David Jazbec
    0

    Umbraco 14 - Request Error Handling

    Hi, i need some help understanding how Umbraco 14 Backoffice handles requests to server (specially how errors are handled).

    I have complete frontend project structure set up. Request/response flow looks like this: sever <-> api <-> datasource <-> repository <-> context <-> element

    Now lets say i have a IActionResult method in my Controller on a server which might returns Ok(payload) or BadRequest(payload) if something went wrong or if validation failed.

    Now when my method returns BadRequest() i want to react to that in my element and display some custom toast notification. But there always pops up this toast notification with "ApiError" as message.

    Is here a nice way to tap into this functionality displaying toast notifications? Does this have something to do with my datasource returning UmbDataSourceResponse<T>?

    I currently have a <uui-toast-notification-container> in my element that i use for my own toast notifications. Could i have used some other mechanism to show those "globally/anytime/anywhere"?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies