Skip to content

Commit a900c9c

Browse files
author
Aasim Khan
committed
Refactor BackgroundTaskState to use string values for improved readability and logging
1 parent e0c4927 commit a900c9c

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

extensions/mssql/src/backgroundTasks/backgroundTasksService.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import { uuid } from "../utils/utils";
99
import logger2 from "../models/logger2";
1010

1111
export enum BackgroundTaskState {
12-
NotStarted = 0,
13-
InProgress = 1,
14-
Succeeded = 2,
15-
SucceededWithWarning = 3,
16-
Failed = 4,
17-
Canceled = 5,
18-
Canceling = 6,
12+
NotStarted = "NotStarted",
13+
InProgress = "InProgress",
14+
Succeeded = "Succeeded",
15+
SucceededWithWarning = "SucceededWithWarning",
16+
Failed = "Failed",
17+
Canceled = "Canceled",
18+
Canceling = "Canceling",
1919
}
2020

2121
export type BackgroundTaskIcon =
@@ -285,8 +285,8 @@ export function toBackgroundTaskStateDisplayString(state: BackgroundTaskState):
285285
case BackgroundTaskState.NotStarted:
286286
return localizedConstants.notStarted;
287287
default:
288-
logger.warn(`Unexpected background task state: ${String(state)}`);
289-
return String(state);
288+
logger.warn(`Unexpected background task state: ${state}`);
289+
return state;
290290
}
291291
}
292292

0 commit comments

Comments
 (0)