Skip to content

[web-console] Improve error popups by including error context#5868

Merged
Karakatiza666 merged 1 commit intomainfrom
error-location
Mar 24, 2026
Merged

[web-console] Improve error popups by including error context#5868
Karakatiza666 merged 1 commit intomainfrom
error-location

Conversation

@Karakatiza666
Copy link
Copy Markdown
Contributor

This helps when the error itself is obscure

Testing: manual

console.log('Original error: ', error)
}
}
const toastError = (scope: string) => (error: Error, durationMs?: number) => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the toastError public API from (error, durationMs?) => void to a curried (scope) => (error, durationMs?) => void — a behavioral change touching every call site. No tests.

Please add Vitest unit tests for at minimum:

  1. toastError(scope)(error) prepends scope: to the message
  2. toastError('')(error) falls back to bare message (the scope ? ... : ... branch at line 6)
  3. catchError(scope, f) surfaces the scoped message when f throws

Pure functions, no DOM needed. Setup: npm install -D vitest jsdom.

{@render start({
text: 'Start',
getAction: (alt) => (alt ? 'start_paused' : 'start'),
action: 'start_paused',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Behavior change: the old getAction: (alt) => (alt ? 'start_paused' : 'start') let users Ctrl/Shift/Meta-click to launch without pausing. That shortcut is gone now — _start_paused always fires start_paused. Intentional?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's intended simplification

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough — intentional removal noted. The test gap is still the open blocker though (the curried toastError and the simplified start action need coverage).

This helps when the error itself is obscure

Signed-off-by: Karakatiza666 <bulakh.96@gmail.com>
@Karakatiza666 Karakatiza666 enabled auto-merge March 23, 2026 22:31
@Karakatiza666 Karakatiza666 added this pull request to the merge queue Mar 23, 2026
Merged via the queue into main with commit f8a519e Mar 24, 2026
1 check passed
@Karakatiza666 Karakatiza666 deleted the error-location branch March 24, 2026 00:57
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.

3 participants