class PostDB::MailLocationError
The MailLocationError
error is used by the MailLocation
class
Attributes
arguments[R]
An array containing additional arguments
attribute[R]
A suberror to describe the error in more detail
Public Class Methods
new(suberror = nil, *args)
click to toggle source
Create a new instance of this exception
Arguments:
suberror: (Symbol|String) args: (Array)
Example:
>> raise PostDB::MailLocationError.new => #<PostDB::MailLocationError:0x00000000000000>
# File lib/postdb/errors/mail_location.rb, line 23 def initialize(suberror = nil, *args) # Store the suberror property (if provided) @suberror = suberror if suberror # Store the arguments @arguments = args end
Public Instance Methods
to_s()
click to toggle source
Convert the error to a string
Example:
>> error.to_s => "Error Description"
Calls superclass method
# File lib/postdb/errors/mail_location.rb, line 37 def to_s case @suberror when :malformed_location "'#{@arguments[0]}' is not a valid location." else super.to_s end end