Exception: Velocity::VelocityException
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Velocity::VelocityException
- Defined in:
- lib/acceleration/velocity.rb
Overview
Generic Velocity API exception thrown when Velocity doesn’t like the arguments supplied in a call or the credentials are incorrect.
Don’t ever raise this yourself; it should be raised only by Velocity::Instance#call
Class Method Summary collapse
-
.exception?(node) ⇒ Boolean
Determines if a response from the API is an exception response.
Instance Method Summary collapse
-
#api_message ⇒ Object
Get the string describing the thrown exception.
-
#initialize(node) ⇒ VelocityException
constructor
Wrap this exception around the XML returned by Velocity.
-
#to_s ⇒ Object
Convert this exception to a string.
Constructor Details
#initialize(node) ⇒ VelocityException
Wrap this exception around the XML returned by Velocity
1265 1266 1267 1268 |
# File 'lib/acceleration/velocity.rb', line 1265 def initialize(node) @node = node super() end |
Class Method Details
.exception?(node) ⇒ Boolean
Determines if a response from the API is an exception response
1258 1259 1260 |
# File 'lib/acceleration/velocity.rb', line 1258 def self.exception?(node) node.root.name == 'exception' end |
Instance Method Details
#api_message ⇒ Object
Get the string describing the thrown exception
1273 1274 1275 |
# File 'lib/acceleration/velocity.rb', line 1273 def @node.xpath('/exception//text()').to_a.join.strip end |
#to_s ⇒ Object
Convert this exception to a string
1280 1281 1282 |
# File 'lib/acceleration/velocity.rb', line 1280 def to_s end |