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

Behaviours propagate error details to FragmentResult #197

Open
tomaszmichalak opened this issue Sep 10, 2020 · 3 comments
Open

Behaviours propagate error details to FragmentResult #197

tomaszmichalak opened this issue Sep 10, 2020 · 3 comments
Assignees

Comments

@tomaszmichalak
Copy link
Member

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like

{
  "operation": {},
  "response": {
    "transition": "fallback", # FR.transition
    "log": {
      "invocations": [
        {
          "transition": "_error",
          "log": {
            "request": {},
            "response": {}
          },
          "error": {
            "code": "INVALID_STATUS_CODE",
            "message": "Internal Server Error"
          }
        },
        {
          "transition": "_error",
          "log": {
            "request": {},
            "response": {}
          },
          "error": {
            "code": "INVALID_STATUS_CODE",
            "message": "Internal Server Error"
          }
        }
      ],
      "transition": "fallback",
      "log": {}
    }, # result.log
    "error": {
      "code": "INVALID_STATUS_CODE",
      "message": "Internal Server Error"
    }
  }
}

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@marcinus
Copy link
Contributor

1a. Extend ActionInvocationLog with transition and errors
1b. Alternatively, consider putting whole fragmentResult as field instead of doActionLog, transition and errors

2a. Rename success to consideredSuccess
2b. Remove success flag?
2c. Instead of success, create an invokerLog field (as JSON)?

Motivation for 2: it's the behaviour (CB or cache action) who decides whether the invocation was successful or not.
This information should be distinguished from the data pulled from FragmentResult.

marcinus pushed a commit that referenced this issue Sep 25, 2020
Populate exception details in FragmentResult and in invocation logs.
marcinus pushed a commit that referenced this issue Oct 1, 2020
tomaszmichalak pushed a commit that referenced this issue Oct 27, 2020
Populate exception details in FragmentResult and in invocation logs.
tomaszmichalak added a commit that referenced this issue Oct 27, 2020
#197 Invoke actions via ActionInvoker.

Co-authored-by: Marcin Szymura <marcin.szymura@cognifide.com>
Co-authored-by: Tomasz Michalak <tomek.michalak@gmail.com>
@tomaszmichalak
Copy link
Member Author

Please add a comment with the example log.

@marcinus
Copy link
Contributor

Ok, so the current solution (merged to master at this time) is as following:

Invoking an action from another one (called a behaviour) may result in a few different outcomes.

  • If action fails in a way that it does not complete (does not deliver FragmentResult), but rather throws an exception (or such an exception is delivered asynchronously), the exception is stored in the error field.
  • Otherwise, if action delivers FragmentResult, then it remains its responsibility to populate the information on any errors that occured during processing into this FragmentResult.

Action may use FragmentResult's error field or provide these details in its ActionLog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants