Skip to content

Commit

Permalink
raise error when invoice is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur-santos-foxbit committed Aug 22, 2024
1 parent 4f72aea commit efa5747
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/lightspark-client/queries/invoices.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def get_invoice(id: nil)

variables = { id: id }.compact

request({ query: query, variables: variables })
response = request({ query: query, variables: variables })

raise LightsparkClient::Errors::ClientError, "Invoice not found" if response["entity"].nil?
end

# this method is deprecated, used only for compatibility
Expand Down

0 comments on commit efa5747

Please sign in to comment.