File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7676 ErrTagNotFound = errors .New (invalidTagMsg )
7777 // ErrDuplicateApp is returned when create an app with an ID that already exists
7878 ErrDuplicateApp = errors .New (duplicateIDMsg )
79+ // ErrUnprocessable is returned when the controller throws a 422.
80+ ErrUnprocessable = errors .New ("Unable to process your request." )
7981)
8082
8183func checkForErrors (res * http.Response ) error {
@@ -175,6 +177,8 @@ func checkForErrors(res *http.Response) error {
175177 return ErrMethodNotAllowed
176178 case 409 :
177179 return ErrConflict
180+ case 422 :
181+ return ErrUnprocessable
178182 case 500 :
179183 return ErrServerError
180184 default :
Original file line number Diff line number Diff line change @@ -243,6 +243,13 @@ func TestErrors(t *testing.T) {
243243 },
244244 expected : ErrConflict ,
245245 },
246+ errorTest {
247+ res : & http.Response {
248+ StatusCode : 422 ,
249+ Body : readCloser ("" ),
250+ },
251+ expected : ErrUnprocessable ,
252+ },
246253 errorTest {
247254 res : & http.Response {
248255 StatusCode : 500 ,
You can’t perform that action at this time.
0 commit comments