Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Comments

Close side panel

fix recognizing InvalidEventError in handleFailedGoError#764

Merged
knopers8 merged 1 commit intoAliceO2Group:masterAliceO2Group/Control:masterfrom
knopers8:fix-failed-go-errorknopers8/Control:fix-failed-go-errorCopy head branch name to clipboard
Oct 31, 2025
Merged

fix recognizing InvalidEventError in handleFailedGoError#764
knopers8 merged 1 commit intoAliceO2Group:masterAliceO2Group/Control:masterfrom
knopers8:fix-failed-go-errorknopers8/Control:fix-failed-go-errorCopy head branch name to clipboard

Conversation

@knopers8
Copy link
Collaborator

Fixing an issue caused by the fact that I have no idea what I'm doing in Go. fsm.InvalidEventError implements Error() with a value receiver, which actually allows to provide an error as a value or as a pointer. However, errors.As() is not smart about it and does not strip the type from references/pointers/etc, so the original version would work only with errors passed as pointers.

This commit modifies the helper to work correctly with errors provided as values, which is the more natural way to use it. Unfortunately it is not possible to prevent a caller from passing an error pointer.

Let's consider it as a part of OCTRL-1064.

Fixing an issue caused by the fact that I have no idea what I'm doing in Go.
fsm.InvalidEventError implements Error() with a value receiver, which actually allows to provide an error as a value or as a pointer.
However, errors.As() is not smart about it and does not strip the type from references/pointers/etc, so the original version would work only with errors passed as pointers.

This commit modifies the helper to work correctly with errors provided as values, which is the more natural way to use it.
Unfortunately it is not possible to prevent a caller from passing an error pointer.

Let's consider it as a part of OCTRL-1064.
@knopers8 knopers8 requested a review from justonedev1 as a code owner October 31, 2025 09:10
@knopers8 knopers8 merged commit a3fd1f2 into AliceO2Group:master Oct 31, 2025
3 checks passed
@knopers8 knopers8 deleted the fix-failed-go-error branch October 31, 2025 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.