Exception: D4H::API::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/d4h/api/error.rb

Overview

Public: Raised when the D4H API returns a non-2xx HTTP response.

The message is built from the response body’s “error” and “message” fields, joined with a colon.

Examples

begin
  client.equipment.show(id: 999_999)
rescue D4H::API::Error => e
  e.message  # => "Not Found: Equipment not found"
end

Direct Known Subclasses

RetriableError