We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
^1.2.7
Darwin 24.1.0 arm64 arm
Run this test, written based on test/response/stream.test.ts:
test/response/stream.test.ts
it('handle stream with exception', async () => { const expected = ['a', 'handled'] const app = new Elysia().get( '/', async function* () { yield 'a' await Bun.sleep(10) throw new Error('My Dummy Error') }, { error({ error }) { return 'handled' } } ) const response = await app .handle(req('/')) .then((x) => x.body) .then((x) => { if (!x) return const reader = x?.getReader() let acc = '' const { promise, resolve } = Promise.withResolvers() reader.read().then(function pump({ done, value }): unknown { if (done) return resolve(acc) expect(value.toString()).toBe(expected.shift()!) acc += value.toString() return reader.read().then(pump) }) return promise }) expect(expected).toHaveLength(0) expect(response).toBe('ahandled') })
I expected that error would handle the exception.
error
The error handler is never called, and the connection isn't closed properly. On Postman, I see this error:
name: "Error" code: "HPE_INVALID_CHUNK_SIZE" message: "Parse Error: Invalid character in chunk size"
and then the connection is closed.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What version of Elysia is running?
^1.2.7
What platform is your computer?
Darwin 24.1.0 arm64 arm
What steps can reproduce the bug?
Run this test, written based on
test/response/stream.test.ts
:What is the expected behavior?
I expected that
error
would handle the exception.What do you see instead?
The
error
handler is never called, and the connection isn't closed properly.On Postman, I see this error:
and then the connection is closed.
The text was updated successfully, but these errors were encountered: