Opened 10 years ago

Closed 10 years ago

#1809 closed defect (fixed)

Model validation failures cause a 422 response with no body

Reported by: Tom Hughes Owned by: Shaun McDonald
Priority: major Milestone:
Component: api Version:
Keywords: Cc:

Description

If a model validation fails then ActiveRecord::RecordInvalid? is thrown and the rails default rescue handler converts that to a 422 HTTP response. We should catch it in the upload controller method (and anywhere else that saves a model...) and return a sensible error.

Change History (1)

comment:1 Changed 10 years ago by Tom Hughes

Resolution: fixed
Status: newclosed

Fixed in r14986.

Note: See TracTickets for help on using tickets.