@@ -8,6 +8,7 @@ import EventEmitter from "events";
8
8
import React , { useEffect , Suspense } from "react" ;
9
9
import { DisposableCollection , WorkspaceInstance , WorkspaceImageBuild , Workspace , WithPrebuild } from "@gitpod/gitpod-protocol" ;
10
10
import { HeadlessLogEvent } from "@gitpod/gitpod-protocol/lib/headless-workspace-log" ;
11
+ import { ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error" ;
11
12
import ContextMenu , { ContextMenuEntry } from "../components/ContextMenu" ;
12
13
import CaretDown from "../icons/CaretDown.svg" ;
13
14
import { getGitpodService , gitpodHostUrl } from "../service/service" ;
@@ -95,6 +96,10 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
95
96
if ( typeof error === 'string' ) {
96
97
error = { message : error } ;
97
98
}
99
+ if ( error ?. code === ErrorCodes . USER_BLOCKED ) {
100
+ this . redirectTo ( gitpodHostUrl . with ( { pathname : '/blocked' } ) . toString ( ) ) ;
101
+ return ;
102
+ }
98
103
this . setState ( { error } ) ;
99
104
}
100
105
}
@@ -138,7 +143,7 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
138
143
this . setState ( { hasImageBuildLogs : true } ) ;
139
144
}
140
145
141
- let error ;
146
+ let error : StartWorkspaceError | undefined ;
142
147
if ( workspaceInstance . status . conditions . failed ) {
143
148
error = { message : workspaceInstance . status . conditions . failed } ;
144
149
}
@@ -186,9 +191,7 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
186
191
const isPrebuilt = WithPrebuild . is ( this . state . workspace ?. context ) ;
187
192
let phase = StartPhase . Preparing ;
188
193
let title = undefined ;
189
- let statusMessage = ! error
190
- ? < p className = "text-base text-gray-400" > Preparing workspace …</ p >
191
- : < p className = "text-base text-gitpod-red w-96" > { error . message } </ p > ;
194
+ let statusMessage = ! ! error ? undefined : < p className = "text-base text-gray-400" > Preparing workspace …</ p > ;
192
195
193
196
switch ( this . state ?. workspaceInstance ?. status . phase ) {
194
197
// unknown indicates an issue within the system in that it cannot determine the actual phase of
0 commit comments