Skip to content

Commit

Permalink
Made call more succinct.
Browse files Browse the repository at this point in the history
  • Loading branch information
usiegj00 committed May 26, 2024
1 parent 4ca661d commit 9b4b189
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module {{moduleName}}
msg = ""
msg = msg + "\nHTTP status code: #{code}" if @code
msg = msg + "\nResponse headers: #{response_headers}" if @response_headers
if @message.nil? || @message.try &.empty?
if @message.try &.empty?
msg = msg + "\nError message: the server returns an error but the HTTP response body is empty."
else
msg = msg + "\nResponse body: #{@message}"
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/crystal/src/petstore/api_error.cr
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module Petstore
msg = ""
msg = msg + "\nHTTP status code: #{code}" if @code
msg = msg + "\nResponse headers: #{response_headers}" if @response_headers
if @message.nil? || @message.try &.empty?
if @message.try &.empty?
msg = msg + "\nError message: the server returns an error but the HTTP response body is empty."
else
msg = msg + "\nResponse body: #{@message}"
Expand Down

0 comments on commit 9b4b189

Please sign in to comment.