Exception: Servus::Schema::UnknownKeyError
- Defined in:
- lib/servus/schema/errors.rb
Overview
Raised when a $ref names a fragment key that is not registered.
This is the error the whole registry design exists to produce. A lookup that returned nil instead would let a service that appears to declare a contract run with no validation at all, indefinitely and silently.
Class Method Summary collapse
-
.for(key, available:) ⇒ UnknownKeyError
Builds the error for a missed lookup, suggesting the nearest key.
Class Method Details
.for(key, available:) ⇒ UnknownKeyError
Builds the error for a missed lookup, suggesting the nearest key.
29 30 31 32 33 |
# File 'lib/servus/schema/errors.rb', line 29 def self.for(key, available:) return new(nothing_registered(key)) if available.empty? new("unknown schema key #{key.inspect}.#{suggestion(key, available)}") end |