module OneLogin::RubySaml::ErrorHandling

Attributes

errors[RW]

Public Instance Methods

append_error(error_msg, soft_override = nil) click to toggle source

Append the cause to the errors array, and based on the value of soft, return false or raise an exception. soft_override is provided as a means of overriding the object's notion of soft for just this invocation.

# File lib/onelogin/ruby-saml/error_handling.rb, line 11
def append_error(error_msg, soft_override = nil)
  @errors << error_msg

  unless soft_override.nil? ? soft : soft_override
    raise ValidationError.new(error_msg)
  end

  false
end
reset_errors!() click to toggle source

Reset the errors array

# File lib/onelogin/ruby-saml/error_handling.rb, line 22
def reset_errors!
  @errors = []
end