Exception: LambdaErrors::LambdaError
- Inherits:
-
StandardError
- Object
- StandardError
- LambdaErrors::LambdaError
- Defined in:
- lib/aws_lambda_ric/lambda_errors.rb
Direct Known Subclasses
LambdaHandlerCriticalException, LambdaHandlerError, LambdaRuntimeError, LambdaRuntimeInitError
Instance Method Summary collapse
-
#initialize(original_error, classification = 'Function') ⇒ LambdaError
constructor
A new instance of LambdaError.
- #runtime_error_type ⇒ Object
- #to_lambda_response ⇒ Object
Constructor Details
#initialize(original_error, classification = 'Function') ⇒ LambdaError
Returns a new instance of LambdaError.
10 11 12 13 14 15 16 |
# File 'lib/aws_lambda_ric/lambda_errors.rb', line 10 def initialize(original_error, classification = 'Function') @error_class = original_error.class.to_s @error_type = "#{classification}<#{original_error.class}>" @error_message = original_error. @stack_trace = _sanitize_stacktrace(original_error.backtrace_locations) super(original_error) end |
Instance Method Details
#runtime_error_type ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/aws_lambda_ric/lambda_errors.rb', line 18 def runtime_error_type if _allowed_error? @error_type else 'Function<UserException>' end end |
#to_lambda_response ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/aws_lambda_ric/lambda_errors.rb', line 26 def to_lambda_response { :errorMessage => @error_message, :errorType => @error_type, :stackTrace => @stack_trace } end |