Skip to content

Commit

Permalink
Merge pull request SAML-Toolkits#76 from newrelic/inherit-from-standa…
Browse files Browse the repository at this point in the history
…rd-error

Don't use Exception, use StandardError
  • Loading branch information
stouset committed Mar 27, 2013
2 parents c0f38a1 + 920eb97 commit 37547a8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/onelogin/ruby-saml/logoutresponse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def valid_saml?(soft = true)
if soft
@schema.validate(@xml).map{ return false }
else
@schema.validate(@xml).map{ |error| raise(Exception.new("#{error.message}\n\n#{@xml.to_s}")) }
@schema.validate(@xml).map{ |error| validation_error("#{error.message}\n\n#{@xml.to_s}") }
end
end

Expand Down Expand Up @@ -151,4 +151,4 @@ def validation_error(message)
end
end
end
end
end
2 changes: 1 addition & 1 deletion lib/onelogin/ruby-saml/validation_error.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Onelogin
module Saml
class ValidationError < Exception
class ValidationError < StandardError
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/logoutresponse_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class RubySamlTest < Test::Unit::TestCase
should "raise error for invalid xml" do
logoutresponse = Onelogin::Saml::Logoutresponse.new(invalid_xml_response, settings)

assert_raises(Exception) { logoutresponse.validate! }
assert_raises(Onelogin::Saml::ValidationError) { logoutresponse.validate! }
end
end

Expand Down

0 comments on commit 37547a8

Please sign in to comment.