Skip to content

Commit

Permalink
[#44] update error handled with sr_json:error/1
Browse files Browse the repository at this point in the history
  • Loading branch information
ferigis committed Sep 13, 2016
1 parent c66179f commit 5d712a6
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 5d712a6

Please sign in to comment.