Merge pull request #4937 from mitchellh/sethvargo/error_format
Use the new Rails error format
This commit is contained in:
commit
6596f7f29d
|
@ -83,10 +83,7 @@ module VagrantPlugins
|
||||||
false
|
false
|
||||||
rescue RestClient::NotAcceptable => e
|
rescue RestClient::NotAcceptable => e
|
||||||
begin
|
begin
|
||||||
errors = JSON.parse(e.response)["errors"]
|
errors = JSON.parse(e.response)["errors"].join("\n")
|
||||||
.map { |h| h["message"] }
|
|
||||||
.join("\n")
|
|
||||||
|
|
||||||
raise Errors::ServerError, errors: errors
|
raise Errors::ServerError, errors: errors
|
||||||
rescue JSON::ParserError; end
|
rescue JSON::ParserError; end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue