Skip to content

Additional info wanted on HTTP Errors #1089

@gkorsten

Description

@gkorsten

Feature Request

Hi,

It would be useful to have additional information sent when http errors are triggered from the backend errors.

If you could grab the response.text() of the error and attach it to evt, it means I can pass the error that the server send directly to the user.

eg.
in go
http.Error(w, "The user has already been added previously.", http.StatusConflict)

in html
<div data-on:datastar-fetch="evt.detail.type == 'error' && alert(evt.detail.message)"></div>

Thanks

Datastar Version

v1rc6

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions