Skip to content

Error Capture Functionality Only Works for Explicit error Return Types #537

Answered by eliottness
korECM asked this question in Q&A
Discussion options

You must be logged in to vote

👋 Thanks for reaching out and trying out orchestrion @korECM

It appears that when using the //dd:span tag, the error capture functionality only activates when the return type is explicitly error. However, in some cases, functions return a different type or an interface that implements error, and the error capture does not seem to work in these cases.

Overall I don't see any problem to implement this. The code that does this type check is in dd-trace-go. There, the template helper ResultOfType "error" only does a formal check of the error type but in theory we could implement something like ResultHasError using types.Implements to check for error types. Would this fit your usecase?

Alte…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@korECM
Comment options

@korECM
Comment options

Answer selected by korECM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants