Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create sumo_single_entity_handler #4

Merged
merged 1 commit into from
Nov 23, 2015

Conversation

elbrujohalcon
Copy link
Member

It has to be built on trails and it has to provide the following endpoints:

  • GET /[entities]/:id - return an entity
  • PUT /[entities]/:id - creates/updates a new entity
  • DELETE /[entities]/:id - deletes an entity

-spec handle_get(cowboy_req:req(), state()) ->
{iodata(), cowboy_req:req(), state()}.
handle_get(Req, State) ->
#{opts := #{model := Model}, entity := Entity} = State,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although it's true that at this point not much can go wrong, the other handle functions are wrapped in a try catch for unforseen exceptions and to return a proper 500 error, should this one do the same or is it overengineering?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our experience dictates that it's impossible to get this function to throw an exception. The main difference is the lack of access to databases or repositories here.

igaray added a commit that referenced this pull request Nov 23, 2015
…ntity_hand

Create sumo_single_entity_handler
@igaray igaray merged commit 2d1c6e7 into master Nov 23, 2015
@igaray igaray deleted the elbrujohalcon.4.create_sumo_single_entity_hand branch November 23, 2015 20:04
@elbrujohalcon elbrujohalcon modified the milestone: 0.1.0 Nov 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants