fix: connection timeout error (#55)

This commit is contained in:
Daniel Rochetti 2024-02-26 14:28:50 -08:00 committed by GitHub
parent 84436e819e
commit 6d112c89c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 1 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "@fal-ai/serverless-client", "name": "@fal-ai/serverless-client",
"description": "The fal serverless JS/TS client", "description": "The fal serverless JS/TS client",
"version": "0.8.5", "version": "0.8.6",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -520,6 +520,12 @@ export const realtimeImpl: RealtimeClient = {
return; return;
} }
if (isFalErrorResult(data)) { 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(); const { onError = noop } = getCallbacks();
onError( onError(
new ApiError({ new ApiError({

View File

@ -6,6 +6,7 @@
"inlineSources": true, "inlineSources": true,
"declaration": true, "declaration": true,
"esModuleInterop": true, "esModuleInterop": true,
"importHelpers": false,
"allowJs": true, "allowJs": true,
"checkJs": false, "checkJs": false,
"types": ["node"] "types": ["node"]