Skip to content

[Question] How do you handle NotFound, Conflict, and Forbidden when editing resources? #41

Open
@ChristopherHaws

Description

@ChristopherHaws

I'm curious how you would handle some common, real world scenarios using command handlers:

  • The resource cannot be found (i.e. If the course could not be found here)
  • The resource has a concurrency token and they don't match when trying to update (which should turn into a 409 Conflict HTTP status code)
  • The user trying to edit a specific resource does not have permission to do so using resource based auth. It seems like the Controller/PageModel should be in charge of handling auth, but then you would have to lookup the resource in the Controller/PageModel to run auth on it and look it up again in the command handler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions