hudmol/archivesspace — pull request #209 by marktriggs (2012-12-29 21:54:18+00:00)
Title: 41484569 locations errors

Assigning to @payten. A better error message for this logic:

When creating a location, a minimum of one of the following is required:

* Barcode
* Classification
* Coordinate 1 Label AND Coordinate 1 Indicator

It's a bit of a kludge, but I think we'll be revising our error handling as a part of making the error messages i18n friendly. Right now I've just modified the error handling to return an error code in this case and that gets looked up in the i18n YML file. Ultimately I think we probably want the backend to return errors in a more rich format, like:

{
:error_code => "some_unique_id",
:affected_fields => ["title"],
:messages => ["title can't be blank"]
}

That way direct users of the API would still get a message they can figure out, but the unique ID can be used by the frontend to look up the YML file.