Module: Foobara::TypeDeclarations::ErrorExtension

Includes:
Concern, WithRegistries
Defined in:
foobara-0.0.110/projects/type_declarations/src/error_extension.rb

Defined Under Namespace

Modules: ClassMethods Classes: NoContextTypeSetError

Instance Method Summary collapse

Methods included from Concern

foobara_class_methods_module_for, foobara_concern?, included

Instance Method Details

#initializeObject



57
58
59
60
61
# File 'foobara-0.0.110/projects/type_declarations/src/error_extension.rb', line 57

def initialize(...)
  super

  validate_context!
end

#validate_context!Object



63
64
65
66
67
68
# File 'foobara-0.0.110/projects/type_declarations/src/error_extension.rb', line 63

def validate_context!
  if TypeDeclarations.validate_error_context_enabled?
    # TODO: we need to wrap this in a new error here to communicate what's going on a bit better
    context_type.process_value!(context)
  end
end