My Library freezes when I use it in a workflow when exceptions occur inside

I built a library for IBM PCOMM (Terminal Automation, known as HOST or Mainframe). Inside some activities I’m throwing system errors. When I’m implementing the library in my workflows, they work properly when I run the activity normally. But if I run as Debug… Every time that reaches an error it freezes:

This is the log when I just run the file (what I need):
image

But then when I debug the same file (It doesn’t continue throwing the error so I can’t keep debugging to handle the error and make test. I can’t even pause, Just stops):
image
image

It’s hard to make test having to run all the code every time, or just making unit testing :frowning:

Any Idea why this behaviours?

Hi @marco.roldan

That might be because the terminal connection is not ended and its getting stuck there…Can you try closing the terminal session before throwing the error?

cheers

Thank you for the reply.

I tried, right now my code is closing session first, still gets stuck when I throw an error. Another thing ti describe the issue is that the workflow that throws the error is nested (parent-child), I mean.

MyMain > LibraryWorkflowParentActivity > LibraryWorkflowChildThrowingError

I tried with both kind of activities “Terminate Workflow” and “Throw”.

The Error Is not being handled in the parent tho.

@marco.roldan

Did you try using a try catch in the parent and then rethrow from there

Not like a must have in library…The issue seems weird but as a resolution step it might work

I have had nested libraries but did not face such issue though

cheers