Skip to content

Commit

Permalink
Merge pull request #43 from alces-flight/develop
Browse files Browse the repository at this point in the history
Split the unexpected API error from network errors
  • Loading branch information
WilliamMcCumstie authored Aug 10, 2020
2 parents 3b9db67 + de55c4c commit cf78319
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/flight_asset/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,16 @@ def run!
Config::CACHE.logger.debug e.backtrace.reverse.join("\n")
Config::CACHE.logger.error "(#{e.class}) #{e.message}"
case e
when SimpleJSONAPIClient::Errors::APIError, Faraday::Error
when SimpleJSONAPIClient::Errors::APIError
raise InternalError, <<~ERROR.chomp
The API responded with an unexpected error, see logs for details:
#{Paint[Config::CACHE.log_path_or_stderr, :yellow]}
ERROR
when Faraday::Error
raise InternalError, <<~ERROR.chomp
Unable to connect to the API server, see logs for details:
#{Paint[Config::CACHE.log_path_or_stderr, :yellow]}
ERROR
else
raise e
end
Expand Down
2 changes: 1 addition & 1 deletion lib/flight_asset/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
#==============================================================================

module FlightAsset
VERSION = '1.1.5'
VERSION = '1.1.6'
end

0 comments on commit cf78319

Please sign in to comment.