Shopify/shopify_theme — pull request #43 by skinnyfit (2013-07-21 16:04:16+00:00)
Title: Fix HTTP error handling

### Problem:

```
$ theme upload
/path/to/gems/shopify_theme-0.0.9/lib/shopify_theme/cli.rb:165:in `errors_from_response': undefined method `values' for # (NoMethodError)
```

### Cause:

- I provide incorrect API credentials and then run some command like `theme upload`
- Shopify returns a 401 Forbidden status with JSON response: `{"errors":"[API] Invalid API key or access token (unrecognized login or wrong password)"}`
- `parsed_response["errors"]` is a `String`
- Ruby tries to call `values` on the string
- :boom:

### Solution:

If `parsed_response["errors"]` is a `String`, just return it.