edx/edx-submissions — pull request #7 by wedaly (2014-07-29 12:48:45+00:00)
Title: Clarify error message and field errors for submission request error

`SubmissionRequestError` is sometimes used to report a specific error message (e.g. when the student item can't be found in the database), and sometimes used to report serializer errors.

This meant that the type of `field_errors` passed to the constructor of the exception was inconsistent: sometimes we passed in a dictionary (from the Django rest framework serializers); other times, we passed in a string. This makes life more difficult for the users of the API, since they need to check the type of `field_errors` before accessing it.

In this PR, I've changed `SubmissionRequestError` to accept either (or both) a message (string) and field_errors (dict). This ensures that `SubmissionRequestError.field_errors` is always a dictionary.