class Mailjet::RequestException

Overview

The error info value may return anything from a string to an array of hashes, so some juggling is needed to drill down to the actual errors. Here is an example:

case exception.error_info
when String
  puts exception.error_info
when Mailjet::Exception::ErrorInfoArray
  if contactslists = exception.error_info["ContactsLists"]?
    puts contactslists.map(&.["Error"]).join(", ")
  end
end

Direct Known Subclasses

Defined in:

mailjet/exception.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(__temp_78 : JSON::PullParser) #

[View source]

Instance Method Detail

def error_info : Exception::ErrorInfo #

[View source]
def error_info=(_error_info : Exception::ErrorInfo) #

[View source]
def error_message : Union(String, Nil) #

[View source]
def error_message=(_error_message : Union(String, Nil)) #

[View source]
def message #

[View source]
def status_code : Union(Int32, Nil) #

[View source]
def status_code=(_status_code : Union(Int32, Nil)) #

[View source]
def to_json(json : JSON::Builder) #

[View source]
def to_s #
Description copied from class Object

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.


[View source]