File tree 1 file changed +14
-5
lines changed
1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -2447,11 +2447,20 @@ class ApiMethods {
2447
2447
labels ?. map ( ( label ) => [ "label" , label ] ) ,
2448
2448
) ;
2449
2449
2450
- const res =
2451
- await this . axios . get < TypesGen . WorkspaceAgentListContainersResponse > (
2452
- `/api/v2/workspaceagents/${ agentId } /containers?${ params . toString ( ) } ` ,
2453
- ) ;
2454
- return res . data ;
2450
+ try {
2451
+ const res =
2452
+ await this . axios . get < TypesGen . WorkspaceAgentListContainersResponse > (
2453
+ `/api/v2/workspaceagents/${ agentId } /containers?${ params . toString ( ) } ` ,
2454
+ ) ;
2455
+ return res . 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
+ throw err ;
2463
+ }
2455
2464
} ;
2456
2465
2457
2466
getInboxNotifications = async ( startingBeforeId ?: string ) => {
You can’t perform that action at this time.
0 commit comments