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

Add ActivityError interface #247

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

debovema
Copy link
Contributor

What kind of change does this PR introduce? (check one with "x")

[] Bugfix
[x] Feature
[] Code style update (formatting, local variables)
[] Refactoring (no functional changes, no api changes)
[] Other... Please describe:

Fixes: N/A

What is the current behavior?
In TaskEvent and FlowEvent interfaces, the TaskError() and FlowError() methods return an object with interface error but it can also be an object of type activity.Error. However there is no interface to expose methods of this type.

What is the new behavior?
An interface has been added.

An example of use-case can be:

func handleErrorInSpan(span opentracing.Span, err error) {
	span.SetTag("error", true)
	span.SetTag("message", err.Error())

	switch err.(type) {
	case activity.ActivityError:
		span.SetTag("error.object", err.(activity.ActivityError).Data())
	}
}

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

Successfully merging this pull request may close these issues.

2 participants