Skip to content

Commit

Permalink
Merge pull request #46 from inaka/ferigis.44.update_error
Browse files Browse the repository at this point in the history
[#44] update error handled with sr_json:error/1
  • Loading branch information
cabol authored Sep 14, 2016
2 parents 53b0bec + 5d712a6 commit 0cc51f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sr_single_entity_handler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ from_json(Module, Id, Json) ->
end.

persist({error, Reason}, Req, State) ->
Req1 = cowboy_req:set_resp_body(Reason, Req),
Req1 = cowboy_req:set_resp_body(sr_json:error(Reason), Req),
{false, Req1, State};
persist({ok, Entity}, Req1, State) ->
#{opts := #{model := Model}, module := Module} = State,
Expand Down

0 comments on commit 0cc51f1

Please sign in to comment.