Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When action fails, no log is provided #168

Open
marcinus opened this issue Jun 27, 2020 · 3 comments
Open

When action fails, no log is provided #168

marcinus opened this issue Jun 27, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@marcinus
Copy link
Contributor

marcinus commented Jun 27, 2020

Describe the bug
When an operation fails (returns a failed future, or throws without returning), the information about the error is available in the downstream. However, TaskEngine does not log or provide this information in any way.

To Reproduce
Steps to reproduce the behavior:
Create an action that throws an exception or returns a failed failure. Invoke TaskEngine on it.

Expected behavior
The information is available in event log.

Actual behavior
The error information is lost

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
TaskExecutionContext actually logs the error:

    if (isFatal(error)) {
      handleFatalError((NodeFatalException) error);
    } else {
      handleRegularError(error);
    }
    FragmentEvent fragmentEvent = fragmentEventContext.getFragmentEvent();
    return Single.just(new FragmentResult(fragmentEvent.getFragment(), ERROR_TRANSITION,
        prepareErrorActionLog(error)));
  }

  private JsonObject prepareErrorActionLog(Throwable error) {
    return new JsonObject()
        .put("error", error.getMessage());
  }

However, it does not get written to the event log, and node log will not be preserved later (perhaps this is an issue too?)

@tomaszmichalak tomaszmichalak added the bug Something isn't working label Jul 10, 2020
@tomaszmichalak tomaszmichalak self-assigned this Jul 13, 2020
@tomaszmichalak
Copy link
Member

Hi @marcinus, I checked this issue. You are right, this is not valid situation. I am verifying how to combine this data with ActionLog to have a single clear "invocation" syntax.

tomaszmichalak added a commit that referenced this issue Jul 17, 2020
Move NodeFatalException to Task API.

Remove timeout status from event log.

CR fix.

Update Changelog and README.

Added log verifier unit tests, tests fixes.

Tests fixes.
tomaszmichalak added a commit that referenced this issue Jul 17, 2020
Move NodeFatalException to Task API.

Remove timeout status from event log.

CR fix.

Update Changelog and README.

Added log verifier unit tests, tests fixes.

Tests fixes.
tomaszmichalak added a commit that referenced this issue Jul 28, 2020
tomaszmichalak added a commit that referenced this issue Jul 30, 2020
#168 Add errors to node response execution log.
@tomaszmichalak
Copy link
Member

Screenshot 2020-08-24 at 13 19 26

The case: HTTP Action handles an exception and adds errors to the node log (response.log.logs.errors). As you can see response.errors is empty as the fragment operation (HTTP Action) has ended without an exception. @marcinus what do you think?

tomaszmichalak added a commit to Knotx/knotx-fragments-chrome-extension that referenced this issue Aug 24, 2020
tomaszmichalak added a commit to Knotx/knotx-fragments-chrome-extension that referenced this issue Aug 24, 2020
@marcinus
Copy link
Contributor Author

@tomaszmichalak Not sure how this relates to the issue? Do you think that HTTP action should propagate exception in this case?
#132 - an issue to control success response codes from HTTP Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants