fix: always throw errors & always use named Error classes #1284
ts_test.yml
on: pull_request
List packages
4s
List examples
3s
Matrix: Build and test
Matrix: check_packages
Matrix: check_and_build_examples
Annotations
7 errors
Check packages/typescript-client:
packages/typescript-client/src/error.ts#L86
Strings must use backtick
|
Check packages/typescript-client:
packages/typescript-client/src/error.ts#L87
Strings must use backtick
|
Check packages/typescript-client:
packages/typescript-client/src/parser.ts#L166
Strings must use backtick
|
Check packages/typescript-client
Process completed with exit code 1.
|
Unhandled error:
packages/typescript-client/src/error.ts#L42
FetchError: HTTP Error 400 at http://localhost:3000/v1/shape?table=electric_test.%22issues+for+509504068_1_15_0.5c2528097fd69%22&where=1%3D1&offset=-1&handle=4108375-1731721119276: {"message":"The specified shape definition and ID do not match. Please ensure the shape definition is correct or omit the shape ID from the request to obtain a new one."}
❯ Function.fromResponse src/error.ts:42:12
❯ processTicksAndRejections node:internal/process/task_queues:95:5
❯ src/fetch.ts:63:20
❯ ShapeStream.prefetchClient src/fetch.ts:132:22
❯ ShapeStream.start src/client.ts:343:22
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { url: 'http://localhost:3000/v1/shape?table=electric_test.%22issues+for+509504068_1_15_0.5c2528097fd69%22&where=1%3D1&offset=-1&handle=4108375-1731721119276', status: 400, text: undefined, json: { message: 'The specified shape definition and ID do not match. Please ensure the shape definition is correct or omit the shape ID from the request to obtain a new one.' }, headers: { 'access-control-allow-methods': 'GET, HEAD, DELETE, OPTIONS', 'access-control-allow-origin': '*', 'access-control-expose-headers': '*', 'cache-control': 'max-age=0, private, must-revalidate', 'content-encoding': 'gzip', 'content-length': '138', 'content-type': 'application/json; charset=utf-8', date: 'Sat, 16 Nov 2024 01:38:38 GMT', server: 'ElectricSQL/0.8.2', vary: 'accept-encoding', 'x-request-id': 'GAhPLtU5fKjPgWkAABCj' } }
This error originated in "test/integration.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.
The latest test that might've caused the error is "should handle invalid requests by terminating stream". It might mean one of the following:
- The error was thrown, while Vitest was running this test.
- If the error occurred after the test had been completed, this was the last documented test before it was thrown.
|
test/parser.test.ts > Message parser > should parse null values:
packages/typescript-client/test/parser.test.ts#L180
AssertionError: expected [Function] to throw error including 'Column a is not nullable' but got 'Column a does not allow NULL values'
Expected: "Column a is not nullable"
Received: "Column a does not allow NULL values"
❯ test/parser.test.ts:180:9
|
Build and test (packages/typescript-client)
Process completed with exit code 1.
|