Class: Utility::DocumentError
- Inherits:
-
Object
- Object
- Utility::DocumentError
- Defined in:
- lib/utility/errors.rb
Instance Attribute Summary collapse
-
#error_class ⇒ Object
Returns the value of attribute error_class.
-
#error_id ⇒ Object
Returns the value of attribute error_id.
-
#error_message ⇒ Object
Returns the value of attribute error_message.
-
#stack_trace ⇒ Object
Returns the value of attribute stack_trace.
Instance Method Summary collapse
-
#initialize(error_class, error_message, stack_trace, error_id) ⇒ DocumentError
constructor
A new instance of DocumentError.
- #to_h ⇒ Object
Constructor Details
#initialize(error_class, error_message, stack_trace, error_id) ⇒ DocumentError
Returns a new instance of DocumentError.
14 15 16 17 18 19 20 21 22 |
# File 'lib/utility/errors.rb', line 14 def initialize(error_class, , stack_trace, error_id) @error_class = error_class @error_message = @error_id = error_id # keywords must be < 32kb, UTF-8 chars can be up to 3 bytes, thus 32k/3 ~= 10k # See https://github.com/elastic/workplace-search-team/issues/1723 @stack_trace = stack_trace.truncate(10_000) end |
Instance Attribute Details
#error_class ⇒ Object
Returns the value of attribute error_class.
12 13 14 |
# File 'lib/utility/errors.rb', line 12 def error_class @error_class end |
#error_id ⇒ Object
Returns the value of attribute error_id.
12 13 14 |
# File 'lib/utility/errors.rb', line 12 def error_id @error_id end |
#error_message ⇒ Object
Returns the value of attribute error_message.
12 13 14 |
# File 'lib/utility/errors.rb', line 12 def @error_message end |
#stack_trace ⇒ Object
Returns the value of attribute stack_trace.
12 13 14 |
# File 'lib/utility/errors.rb', line 12 def stack_trace @stack_trace end |
Instance Method Details
#to_h ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/utility/errors.rb', line 24 def to_h { 'error_class' => error_class, 'error_message' => , 'stack_trace' => stack_trace, 'error_id' => error_id } end |