EasyPost Error object.
EasyPost
Error
# File lib/easypost/models/error.rb, line 15 def self.from_api_error_response(data) code = data['code'] field = data['field'] || nil message = data['message'] || nil EasyPost::Models::Error.new(code, field, message) end
Create an EasyPost Error from an API error response.
# File lib/easypost/models/error.rb, line 8 def initialize(code, field = nil, message = nil) @code = code @field = field @message = message end
Initialize a new EasyPost Error