Module: OneLogin::RubySaml::ErrorHandling

Included in:
Logoutresponse, Response, SloLogoutrequest, XMLSecurity::SignedDocument
Defined in:
lib/onelogin/ruby-saml/error_handling.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#errorsObject

Returns the value of attribute errors.



6
7
8
# File 'lib/onelogin/ruby-saml/error_handling.rb', line 6

def errors
  @errors
end

Instance Method Details

#append_error(error_msg, soft_override = nil) ⇒ Object

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.



11
12
13
14
15
16
17
18
19
# 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!Object

Reset the errors array



22
23
24
# File 'lib/onelogin/ruby-saml/error_handling.rb', line 22

def reset_errors!
  @errors = []
end