Exception: Dependabot::SharedHelpers::HelperSubprocessFailed

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

Constant Summary

Constants inherited from DependabotError

DependabotError::BASIC_AUTH_REGEX, DependabotError::FURY_IO_PATH_REGEX

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message:, error_context:, error_class: nil, trace: nil) ⇒ HelperSubprocessFailed

Returns a new instance of HelperSubprocessFailed.



113
114
115
116
117
118
119
120
# File 'lib/dependabot/shared_helpers.rb', line 113

def initialize(message:, error_context:, error_class: nil, trace: nil)
  super(message)
  @error_class = T.let(error_class || "HelperSubprocessFailed", String)
  @error_context = error_context
  fingerprint = error_context[:fingerprint] || error_context[:command]
  @fingerprint = T.let(fingerprint.is_a?(String) ? fingerprint : nil, T.nilable(String))
  @trace = trace
end

Instance Attribute Details

#error_classObject (readonly)

Returns the value of attribute error_class.



97
98
99
# File 'lib/dependabot/shared_helpers.rb', line 97

def error_class
  @error_class
end

#error_contextObject (readonly)

Returns the value of attribute error_context.



100
101
102
# File 'lib/dependabot/shared_helpers.rb', line 100

def error_context
  @error_context
end

#traceObject (readonly)

Returns the value of attribute trace.



103
104
105
# File 'lib/dependabot/shared_helpers.rb', line 103

def trace
  @trace
end

Instance Method Details

#sentry_contextObject



123
124
125
# File 'lib/dependabot/shared_helpers.rb', line 123

def sentry_context
  { fingerprint: [@fingerprint], extra: @error_context.except(:stderr_output, :fingerprint) }
end