Exception: CvssSuite::Errors::InvalidVector

Inherits:
RuntimeError
  • Object
show all
Includes:
CvssSuite::Error
Defined in:
lib/cvss_suite/errors.rb

Overview

Raised for a vector this gem cannot parse, and by every score reader on a vector valid? has rejected.

Class Method Summary collapse

Class Method Details

.for(vector) ⇒ Object

Builds the error for the vector that was rejected, naming it in the message. Takes the raw input rather than a string, so a caller who passed nil or an Integer is told that, instead of being shown '""'.



46
47
48
# File 'lib/cvss_suite/errors.rb', line 46

def self.for(vector)
  new("Vector is not valid: #{describe(vector)}")
end