Skip to content

Fix uninformative collection errors for non-mirai errorValues - #643

Merged
shikokuchuo merged 3 commits into
mainfrom
fix-stop-m-messages
Jul 17, 2026
Merged

Fix uninformative collection errors for non-mirai errorValues#643
shikokuchuo merged 3 commits into
mainfrom
fix-stop-m-messages

Conversation

@shikokuchuo

Copy link
Copy Markdown
Member

stop_m() read a message attribute that only a 'miraiError' carries, so .stop / .flat collection of a cancelled, timed-out, or connection-reset task raised a bare "In index: 1." with cli, and an entirely empty message without it.

The message is now derived by error kind: the message attribute for a 'miraiError' as before, nng_error() for integer 'errorValue's (which includes the code, e.g. "20 | Operation canceled"), and "Interrupted" for a 'miraiInterrupt'. The cli branch gains a proper errorCondition() parent so the cause is reported in the chain. All changes are on the terminal error path, so there is no impact on collection hot paths.

The test forces the base branch via cli_enabled to stay meaningful on runners with cli but not rlang, and matches "In index", which the pre-fix empty message fails.

Closes #642.

@shikokuchuo
shikokuchuo merged commit 49cd591 into main Jul 17, 2026
11 checks passed
@shikokuchuo
shikokuchuo deleted the fix-stop-m-messages branch July 17, 2026 11:44
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.

Uninformative errors from mirai_map() collection for non-mirai errorValues

1 participant