Skip to content

Feat: Error handling on the Backend to report human errors #1983

@Emyrk

Description

@Emyrk

What is your suggestion?

Ensure backend errors returned to the UI are human readable. Currently we elevate err.Error() a lot, which is not a good UI experience.

httpapi.Write(rw, http.StatusForbidden, httpapi.Response{
     Message: "Human message here",
     Internal: err.Error(),
})

Why do you want this feature?

So the backend can send appropriate errors over to the frontend.

This was a consequence of 2 cases (suspended user login and ...?...) where the backend error had more details than the FE.

Are there any workarounds to get this functionality today?

No

Are you interested in submitting a PR for this?

Yes

Metadata

Metadata

Assignees

Labels

apiArea: HTTP API

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy