Skip to content

Commit

Permalink
Merge pull request #41 from alces-flight/develop
Browse files Browse the repository at this point in the history
Change API errors to a human readable format
  • Loading branch information
WilliamMcCumstie authored Aug 7, 2020
2 parents d74ed28 + dea27f0 commit 1743fea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion lib/flight_asset/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ def run!
end
Config::CACHE.logger.debug e.backtrace.reverse.join("\n")
Config::CACHE.logger.error "(#{e.class}) #{e.message}"
raise e
case e
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
else
raise e
end
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.3'
VERSION = '1.1.4'
end

0 comments on commit 1743fea

Please sign in to comment.