Exception: BetterService::Errors::Workflowable::Runtime::WorkflowExecutionError

Inherits:
WorkflowRuntimeError show all
Defined in:
lib/better_service/errors/workflowable/runtime/workflow_execution_error.rb

Overview

Raised when workflow execution fails

This error is raised when unexpected errors occur during workflow execution, wrapping the original exception with workflow context.

Examples:

Workflow execution failure

class MyWorkflow < BetterService::Workflow
  step :create_user,
       with: User::CreateService

  step :send_email,
       with: Email::WelcomeService
end

MyWorkflow.new(user, params: {}).call
# If unexpected error occurs => raises WorkflowExecutionError

Error context

begin
  MyWorkflow.new(user, params: params).call
rescue BetterService::Errors::Workflowable::Runtime::WorkflowExecutionError => e
  e.context
  # => {
  #   workflow: "MyWorkflow",
  #   steps_executed: [:create_user],
  #   steps_skipped: []
  # }
end

Instance Attribute Summary

Attributes inherited from BetterServiceError

#code, #context, #original_error, #timestamp

Method Summary

Methods inherited from BetterServiceError

#backtrace, #detailed_message, #initialize, #inspect, #to_h

Constructor Details

This class inherits a constructor from BetterService::BetterServiceError