Exception: Fontisan::VariationError
- Defined in:
- lib/fontisan/error.rb
Overview
Base variation error with context and suggestions
Provides detailed error information including context hash and actionable suggestions for resolution.
Direct Known Subclasses
CorruptedVariationDataError, DeltaMismatchError, InvalidAxisError, InvalidCoordinatesError, InvalidInstanceIndexError, InvalidVariationDataError, MissingVariationTableError, RegionOverlapError, VariationDataCorruptedError
Instance Attribute Summary collapse
-
#context ⇒ Hash
readonly
Error context (axis, value, range, etc.).
-
#suggestion ⇒ String?
readonly
Suggested fix.
Instance Method Summary collapse
-
#detailed_message ⇒ String
Get detailed error message with context and suggestion.
-
#initialize(message, context: {}, suggestion: nil) ⇒ VariationError
constructor
Initialize variation error.
Constructor Details
#initialize(message, context: {}, suggestion: nil) ⇒ VariationError
Initialize variation error
34 35 36 37 38 |
# File 'lib/fontisan/error.rb', line 34 def initialize(, context: {}, suggestion: nil) super() @context = context @suggestion = suggestion end |
Instance Attribute Details
#context ⇒ Hash (readonly)
Returns Error context (axis, value, range, etc.).
24 25 26 |
# File 'lib/fontisan/error.rb', line 24 def context @context end |
#suggestion ⇒ String? (readonly)
Returns Suggested fix.
27 28 29 |
# File 'lib/fontisan/error.rb', line 27 def suggestion @suggestion end |
Instance Method Details
#detailed_message ⇒ String
Get detailed error message with context and suggestion
43 44 45 46 47 48 |
# File 'lib/fontisan/error.rb', line 43 def msg = msg += "\nContext: #{@context.inspect}" if @context.any? msg += "\nSuggestion: #{@suggestion}" if @suggestion msg end |