Skip to content

Proper Stacktraces when using Reactor directly #280

@PhilWaldmann

Description

@PhilWaldmann

Code of Conduct

  • I agree to follow this project's Code of Conduct

AI Policy

  • I agree to follow this project's AI Policy, or I agree that AI was not used while creating this issue.

Is your feature request related to a problem? Please describe.

Hi,

I really enjoying using reactor, except when I need to debug my own code.
The reactor error struct is horrible to use, wenn calling reactor directly. I'm not sure if I'm missing something, but I can't find a printable stacktrace. The struct contains all inputs, which in some cases just overflows the IDE terminal. Pinpointing the error with these information is very hard:

{:error,
 %Reactor.Error.Invalid{
   errors: [
     %Reactor.Error.Invalid.RunStepError{
       error: %Reactor.Error.Invalid.TransformError{
         input: %{
           input_a: [
             # many lines
           ],
           input_b: [
             # many lines
           ],
           input_b: [
             # many lines
           ],
           # ...
           input_x: [
             # many lines
           ]
         },
         output: nil,
         error: %Reactor.Error.Invalid.TransformError{
           input: %{
              input_a: [
                # many lines
              ],
              input_b: [
                # many lines
              ],
              input_b: [
                # many lines
              ],
              # ...
              input_x: [
                # many lines
              ]
           },
           output: nil,
           error: %Protocol.UndefinedError{
             protocol: Enumerable,
             value: :ok,
             description: ""
           },
           splode: nil,
           bread_crumbs: [],
           vars: [],
           path: [],
           stacktrace: #Splode.Stacktrace<>,
           class: :invalid
         },
         splode: nil,
         bread_crumbs: [],
         vars: [],
         path: [],
         stacktrace: #Splode.Stacktrace<>,
         class: :invalid
       },
       step: %Reactor.Step{
         arguments: [
           # ...
         ],
         async?: false,
         context: %{},
         description: nil,
         impl: {Reactor.Step.TransformAll,
          [
            fun: &Some.Helper.Module.transform_0_generated_4ABE635460C60816F7BCB00399BBCD0D/1
          ]},
         name: {:__reactor__, :transform, :data},
         max_retries: 0,
         ref: {:__reactor__, :transform, :data},
         transform: nil,
         guards: []
       },
       splode: Reactor.Error,
       bread_crumbs: [],
       vars: [],
       path: [],
       stacktrace: #Splode.Stacktrace<>,
       class: :invalid
     }
   ],
   splode: Reactor.Error,
   bread_crumbs: [],
   vars: [],
   path: [],
   stacktrace: #Splode.Stacktrace<>,
   class: :unknown
 }}

I'm calling my reactor module via Reactor.run(My.Reactor.Module). Any advice on how to get proper elixir stacktraces?

Describe the solution you'd like

Somehow access the original elixir stacktrace

Describe alternatives you've considered

No response

Additional context

reactor 0.17.0
splode 0.2.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions