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

Commit9d57279

Browse files
committed
fix(site): handle containers disabled
1 parent3ebf2d3 commit9d57279

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

‎site/src/api/api.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2447,11 +2447,20 @@ class ApiMethods {
24472447
labels?.map((label)=>["label",label]),
24482448
);
24492449

2450-
constres=
2451-
awaitthis.axios.get<TypesGen.WorkspaceAgentListContainersResponse>(
2452-
`/api/v2/workspaceagents/${agentId}/containers?${params.toString()}`,
2453-
);
2454-
returnres.data;
2450+
try{
2451+
constres=
2452+
awaitthis.axios.get<TypesGen.WorkspaceAgentListContainersResponse>(
2453+
`/api/v2/workspaceagents/${agentId}/containers?${params.toString()}`,
2454+
);
2455+
returnres.data;
2456+
}catch(err){
2457+
// If the error is a 403, it means that experimental
2458+
// containers are not enabled on the agent.
2459+
if(isAxiosError(err)&&err.response?.status===403){
2460+
return{containers:[]};
2461+
}
2462+
throwerr;
2463+
}
24552464
};
24562465

24572466
getInboxNotifications=async(startingBeforeId?:string)=>{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp