if_error: if not found, present a not found message
This commit is contained in:
parent
f5d6475d2d
commit
901c24ab27
1 changed files with 1 additions and 1 deletions
|
@ -64,7 +64,7 @@ let if_error ?(status = `Internal_Server_Error) ?(log=(fun e -> Log.warn (fun m
|
||||||
let* r = r in
|
let* r = r in
|
||||||
match r with
|
match r with
|
||||||
| Error `Not_found ->
|
| Error `Not_found ->
|
||||||
Lwt_result.fail (message, `Not_Found)
|
Lwt_result.fail ("Resource not found", `Not_Found)
|
||||||
| Error (#Model.error as e) ->
|
| Error (#Model.error as e) ->
|
||||||
log e;
|
log e;
|
||||||
Lwt_result.fail (message, status)
|
Lwt_result.fail (message, status)
|
||||||
|
|
Loading…
Reference in a new issue