refactor invalid form handling
This commit is contained in:
parent
3796a96997
commit
9779ad88cf
3 changed files with 17 additions and 40 deletions
|
|
@ -130,7 +130,4 @@ let post request =
|
|||
| Ok () -> pp_discussion (request, user_id, comrade_id)
|
||||
| Error e -> Utils.render e request
|
||||
end
|
||||
| `Ok _ -> Dream.respond ~status:`Bad_Request "invalid form"
|
||||
| `Expired _ | `Many_tokens _ | `Missing_token _ | `Invalid_token _
|
||||
| `Wrong_session _ | `Wrong_content_type ->
|
||||
Dream.empty `Bad_Request )
|
||||
| form -> Utils.handle_invalid_form form )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue