Skip to content

feat(computedAsync): use globalThis.reportError as default onError #4943

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 8, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat(computedAsync): use globalThis.reportError as default onError
  • Loading branch information
babu-ch committed Aug 6, 2025
commit 26d7d2b86d47dd6d572a3247e25b85a0b8d59ac0
5 changes: 3 additions & 2 deletions packages/core/computedAsync/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ describe('computedAsync', () => {
const mockReportError = vi.fn()
globalThis.reportError = mockReportError

const error = new Error('An Error Message')
const func = vi.fn(async () => {
throw new Error('An Error Message')
throw error
})

const data = computedAsync(func, undefined)
Expand All @@ -72,7 +73,7 @@ describe('computedAsync', () => {

await nextTick()
expect(data.value).toBeUndefined()
expect(mockReportError).toHaveBeenCalledWith(new Error('An Error Message'))
expect(mockReportError).toHaveBeenCalledWith(error)
globalThis.reportError = originalReportError
})

Expand Down