Skip to content

feat: add VS code notifications for workspace actions #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Jun 27, 2023
Merged
Prev Previous commit
capture all errors
  • Loading branch information
Kira-Pilot committed Jun 27, 2023
commit 450d0540193ca94a5f8c9bd632240c4d9e37b71b
13 changes: 11 additions & 2 deletions src/WorkspaceAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ export class WorkspaceAction {
try {
ownedWorkspacesResponse = await getWorkspaces({ q: "owner:me" })
} catch (error) {
if (!axios.isAxiosError(error) || error.response?.status !== 401) {
let status
if (axios.isAxiosError(error)) {
status = error.response?.status
}
if (status !== 401) {
storage.writeToCoderOutputChannel(
`Failed to fetch owned workspaces. Some workspace notifications may be missing: ${error}`,
)
Expand Down Expand Up @@ -110,7 +114,12 @@ export class WorkspaceAction {
this.notifyAll()
} catch (error) {
errorCount++
if (!axios.isAxiosError(error) || error.response?.status !== 401) {

let status
if (axios.isAxiosError(error)) {
status = error.response?.status
}
if (status !== 401) {
this.storage.writeToCoderOutputChannel(
`Failed to poll owned workspaces. Some workspace notifications may be missing: ${error}`,
)
Expand Down