Skip to content

Wrap remaining toFile() rejects in Error instances#33

Open
1letme wants to merge 1 commit into
Migushthe2nd:mainfrom
1letme:fix-tofile-string-rejects
Open

Wrap remaining toFile() rejects in Error instances#33
1letme wants to merge 1 commit into
Migushthe2nd:mainfrom
1letme:fix-tofile-string-rejects

Conversation

@1letme

@1letme 1letme commented Jun 1, 2026

Copy link
Copy Markdown

Follow-up to 2.0.5's onerror fix. The two remaining string rejects in toFile() get wrapped in new Error(...) so callers get a proper Error (stack, instanceof, structured logging).

Also updates the should not write to file if no data test from .rejects.toMatch("No audio") to .rejects.toThrow("No audio data received")toMatch is for string rejects, toThrow is the right matcher for Errors and also asserts instanceof Error.

Fixes #32.

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.

toFile() rejects with plain strings instead of Error instances

1 participant