Sha256: f77959ecd26d7ed41cfb2b1409e892461be4737ae21824038559d3223de3e4ac

Contents?: true

Size: 1.57 KB

Versions: 213

Compression:

Stored size: 1.57 KB

Contents

# typed: true
# frozen_string_literal: true

module T::Private::ErrorHandler
  # Handle a rescued TypeError. This will pass the TypeError to the
  # T::Configuration.inline_type_error_handler so that the user can override
  # error handling if they wish. If no inline_type_error_handler is set, this
  # method will call handle_inline_type_error_default, which raises the error.
  def self.handle_inline_type_error(type_error)
    T::Configuration.inline_type_error_handler(type_error)
    nil
  end

  # Handle a sig declaration failure. This allows users to override the behavior
  # when a sig decl fails. If T::Configuration.sig_builder_error_handler
  # is unset, this method will call handle_sig_builder_error_default.
  def self.handle_sig_builder_error(error, location)
    T::Configuration.sig_builder_error_handler(error, location)
    nil
  end

  # Handle a sig build validation failure. This allows users to override the
  # behavior when a sig build fails. If T::Configuration.sig_validation_error_handler
  # is unset, this method will call handle_sig_validation_error_default.
  def self.handle_sig_validation_error(error, opts={})
    T::Configuration.sig_validation_error_handler(error, opts)
    nil
  end

  # Handle a sig call validation failure. This allows users to override the
  # behavior when a sig call fails. If T::Configuration.call_validation_error_handler
  # is unset, this method will call handle_call_validation_error_default.
  def self.handle_call_validation_error(signature, opts={})
    T::Configuration.call_validation_error_handler(signature, opts)
    nil
  end
end

Version data entries

213 entries across 213 versions & 1 rubygems

Version Path
sorbet-runtime-0.4.4382 lib/types/private/error_handler.rb
sorbet-runtime-0.4.4381 lib/types/private/error_handler.rb
sorbet-runtime-0.4.4380 lib/types/private/error_handler.rb
sorbet-runtime-0.4.4379 lib/types/private/error_handler.rb
sorbet-runtime-0.4.4378 lib/types/private/error_handler.rb
sorbet-runtime-0.4.4375 lib/types/private/error_handler.rb
sorbet-runtime-0.4.4374 lib/types/private/error_handler.rb
sorbet-runtime-0.4.4373 lib/types/private/error_handler.rb
sorbet-runtime-0.4.4372 lib/types/private/error_handler.rb
sorbet-runtime-0.4.4371 lib/types/private/error_handler.rb
sorbet-runtime-0.4.4369 lib/types/private/error_handler.rb
sorbet-runtime-0.4.4368 lib/types/private/error_handler.rb
sorbet-runtime-0.4.4367 lib/types/private/error_handler.rb
sorbet-runtime-0.4.4366 lib/types/private/error_handler.rb
sorbet-runtime-0.4.4365 lib/types/private/error_handler.rb
sorbet-runtime-0.4.4364 lib/types/private/error_handler.rb
sorbet-runtime-0.4.4363 lib/types/private/error_handler.rb
sorbet-runtime-0.4.4362 lib/types/private/error_handler.rb
sorbet-runtime-0.4.4361 lib/types/private/error_handler.rb
sorbet-runtime-0.4.4359 lib/types/private/error_handler.rb