Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2cfc907

Browse files
authored
Merge pull request#255 from sqlitecloud/fix-connection-ws-scaled-down-proj-error
2 parentse56ed2d +7bedae1 commit2cfc907

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"@sqlitecloud/drivers",
3-
"version":"1.0.626",
3+
"version":"1.0.653",
44
"description":"SQLiteCloud drivers for Typescript/Javascript in edge, web and node clients",
55
"main":"./lib/index.js",
66
"types":"./lib/index.d.ts",

‎src/drivers/connection-ws.ts‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,28 @@ export class SQLiteCloudWebsocketConnection extends SQLiteCloudConnection {
3232
constconnectionstring=this.config.connectionstringasstring
3333
constgatewayUrl=this.config?.gatewayurl||`${this.config.host==='localhost' ?'ws' :'wss'}://${this.config.hostasstring}:4000`
3434
this.socket=io(gatewayUrl,{auth:{token:connectionstring}})
35-
35+
3636
this.socket.on('connect',()=>{
3737
callback?.call(this,null)
3838
})
3939

40-
this.socket.on('disconnect',(reason)=>{
40+
this.socket.on('disconnect',reason=>{
4141
this.close()
4242
callback?.call(this,newSQLiteCloudError('Disconnected',{errorCode:'ERR_CONNECTION_ENDED',cause:reason}))
4343
})
4444

45+
this.socket.on('connect_error',(error:any)=>{
46+
this.close()
47+
callback?.call(
48+
this,
49+
newSQLiteCloudError(JSON.parse(error.context.responseText).message||'Connection error',{errorCode:'ERR_CONNECTION_ERROR'})
50+
)
51+
})
52+
4553
this.socket.on('error',(error:Error)=>{
4654
this.close()
4755
callback?.call(this,newSQLiteCloudError('Connection error',{errorCode:'ERR_CONNECTION_ERROR',cause:error}))
48-
})
56+
})
4957
}
5058
}catch(error){
5159
callback?.call(this,errorasError)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp