class RipeDbClient::BadParameter
This error is raised when a user has not specified a value for a mandatory parameter
raise RipeDbClient::BadParameter.new("search parameter missing", "dblookup")
The passed message, action, and subject are optional and can later be retrieved when rescuing from the exception.
exception.message # => "search parameter missing" exception.action # => "dblookup"
If the message is not specified (or is nil) it will default to “You have an Invalid or Missing Parameter” This default can be overridden by setting default_message.
exception.default_message = "Default error message" exception.message # => "Default error message"
@author Mike Simkins
Attributes
action[R]
default_message[W]
subject[R]
Public Class Methods
new(message = nil, action = nil, subject = nil)
click to toggle source
# File lib/ripe_db_client/exceptions.rb, line 35 def initialize (message = nil, action = nil, subject = nil) @message = message @action = action @subject = subject @default_message = "You have an Invalid or Missing Parameter" end
Public Instance Methods
to_s()
click to toggle source
@return [String] Returns the error message
# File lib/ripe_db_client/exceptions.rb, line 44 def to_s @message || @default_message end