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

Commitdb42c63

Browse files
committed
Merge branch 'fix/unhandled-fetch-errors' into 'master'
fix: fetch failed on connection refused callsSee merge request postgres-ai/database-lab!459
2 parentsd63a96e +1ed242b commitdb42c63

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

‎ui/packages/ce/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@
5252
"stylelint-config-standard-scss":"^2.0.1",
5353
"stylelint-prettier":"^2.0.0"
5454
},
55-
"proxy":"https://sss.aws.postgres.ai"
55+
"proxy":"https://nik-tf-test.aws.postgres.ai:446/api"
5656
}

‎ui/packages/shared/helpers/request.ts‎

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,29 @@ const serializeParams = (params: RequestParams | null) => {
1919
returnsearchParams.toString()
2020
}
2121

22-
constcreateUrl=(
23-
path:string,
24-
params:RequestParams|null,
25-
)=>{
22+
constcreateUrl=(path:string,params:RequestParams|null)=>{
2623
constserializedParams=serializeParams(params)
2724
constqueryString=serializedParams ?`?${serializedParams}` :''
2825
return`${path}${queryString}`
2926
}
3027

31-
exportconstrequest=(path:string,options?:RequestOptions)=>{
28+
exportconstrequest=async(path:string,options?:RequestOptions)=>{
3229
const{ params=null, ...requestInit}=options??{}
3330

3431
consturl=createUrl(path,params)
3532

36-
returnwindow.fetch(url,{
37-
...requestInit,
38-
headers:{
39-
'Content-Type':'application/json',
40-
...requestInit?.headers,
41-
},
42-
})
33+
try{
34+
returnawaitwindow.fetch(url,{
35+
...requestInit,
36+
headers:{
37+
'Content-Type':'application/json',
38+
...requestInit?.headers,
39+
},
40+
})
41+
}catch(e){
42+
returnnewResponse(null,{
43+
status:500,
44+
statusText:`Unknown error`,
45+
})
46+
}
4347
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp