Exception: Aspera::Cli::BadIdentifier
- Defined in:
- lib/aspera/cli/error.rb
Overview
Raised when a lookup for a specific entity fails to return exactly one result.
Provides a formatted message indicating whether the entity was missing or if multiple matches were found (ambiguity).
Instance Method Summary collapse
-
#initialize(res_type, res_id, field: 'identifier', count: 0) ⇒ BadIdentifier
constructor
A new instance of BadIdentifier.
Constructor Details
#initialize(res_type, res_id, field: 'identifier', count: 0) ⇒ BadIdentifier
Returns a new instance of BadIdentifier.
21 22 23 24 |
# File 'lib/aspera/cli/error.rb', line 21 def initialize(res_type, res_id, field: 'identifier', count: 0) msg = count.eql?(0) ? 'not found' : "found #{count}" super("#{res_type} with #{field}=#{res_id}: #{msg}") end |