Class: Julewire::Core::Serialization::ExceptionShape
- Inherits:
-
Object
- Object
- Julewire::Core::Serialization::ExceptionShape
- Defined in:
- lib/julewire/core/serialization/exception_shape.rb
Constant Summary collapse
- DEFAULT_MAX_CAUSE_DEPTH =
5
Class Method Summary collapse
Instance Method Summary collapse
- #call(error) ⇒ Object
-
#initialize(max_backtrace_lines:, max_cause_depth:) ⇒ ExceptionShape
constructor
A new instance of ExceptionShape.
Constructor Details
#initialize(max_backtrace_lines:, max_cause_depth:) ⇒ ExceptionShape
Returns a new instance of ExceptionShape.
20 21 22 23 24 |
# File 'lib/julewire/core/serialization/exception_shape.rb', line 20 def initialize(max_backtrace_lines:, max_cause_depth:) @backtrace_limiter = BacktraceLimiter.new(max_backtrace_lines: max_backtrace_lines) @include_backtraces = max_backtrace_lines.positive? @max_cause_depth = Validation.validate_integer_limit!(max_cause_depth, name: :max_cause_depth) end |
Class Method Details
.call(error, max_backtrace_lines: Core::MAX_BACKTRACE_LINES, max_cause_depth: DEFAULT_MAX_CAUSE_DEPTH) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/julewire/core/serialization/exception_shape.rb', line 12 def call(error, max_backtrace_lines: Core::MAX_BACKTRACE_LINES, max_cause_depth: DEFAULT_MAX_CAUSE_DEPTH) new( max_backtrace_lines: max_backtrace_lines, max_cause_depth: max_cause_depth ).call(error) end |