Skip to content

Commit

Permalink
fix(api): add error codes to coming from RemoteExceptions (#172)
Browse files Browse the repository at this point in the history
in the command controller
  • Loading branch information
stakach committed Mar 28, 2022
1 parent 292f524 commit 32edce9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/api/command.cr
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ module PlaceOS::Core::Api
end
rescue error : PlaceOS::Driver::RemoteException
Log.error(exception: error) { "execute errored" }
response.headers[RESPONSE_CODE_HEADER] = error.code.to_s
render :non_authoritative_information, json: {
message: error.message,
backtrace: error.backtrace?,
Expand Down

0 comments on commit 32edce9

Please sign in to comment.