Skip to content

Commit

Permalink
fix: connection timeout error (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
drochetti authored Feb 26, 2024
1 parent 84436e8 commit 6d112c8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libs/client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@fal-ai/serverless-client",
"description": "The fal serverless JS/TS client",
"version": "0.8.5",
"version": "0.8.6",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
6 changes: 6 additions & 0 deletions libs/client/src/realtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,12 @@ export const realtimeImpl: RealtimeClient = {
return;
}
if (isFalErrorResult(data)) {
if (data.error === 'TIMEOUT') {
// Timeout error messages just indicate that the connection hasn't
// received an incoming message for a while. We don't need to
// handle them as errors.
return;
}
const { onError = noop } = getCallbacks();
onError(
new ApiError({
Expand Down
1 change: 1 addition & 0 deletions libs/client/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"inlineSources": true,
"declaration": true,
"esModuleInterop": true,
"importHelpers": false,
"allowJs": true,
"checkJs": false,
"types": ["node"]
Expand Down

0 comments on commit 6d112c8

Please sign in to comment.