Class: Dependabot::TypedDependabotError

Inherits:
DependabotError
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dependabot/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_type, message = nil) ⇒ TypedDependabotError

Returns a new instance of TypedDependabotError.



485
486
487
488
489
# File 'lib/dependabot/errors.rb', line 485

def initialize(error_type, message = nil)
  @error_type = T.let(error_type, String)

  super(message || error_type)
end

Instance Attribute Details

#error_typeObject (readonly)

Returns the value of attribute error_type.



482
483
484
# File 'lib/dependabot/errors.rb', line 482

def error_type
  @error_type
end

Instance Method Details

#detail(hash = nil) ⇒ Object



492
493
494
495
496
497
498
499
# File 'lib/dependabot/errors.rb', line 492

def detail(hash = nil)
  {
    "error-type": error_type,
    "error-detail": hash || {
      message: message
    }
  }
end