mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
Introduce new inline chat error type for showing to the user (#208098)
Introduce new error type for showing to the user
This commit is contained in:
@@ -33,6 +33,14 @@ type SessionData = {
|
||||
store: IDisposable;
|
||||
};
|
||||
|
||||
export class InlineChatError extends Error {
|
||||
static readonly code = 'InlineChatError';
|
||||
constructor(message: string) {
|
||||
super(message);
|
||||
this.name = InlineChatError.code;
|
||||
}
|
||||
}
|
||||
|
||||
export class InlineChatSessionServiceImpl implements IInlineChatSessionService {
|
||||
|
||||
declare _serviceBrand: undefined;
|
||||
@@ -92,7 +100,7 @@ export class InlineChatSessionServiceImpl implements IInlineChatSessionService {
|
||||
} catch (error) {
|
||||
this._logService.error('[IE] FAILED to prepare session', provider.debugName);
|
||||
this._logService.error(error);
|
||||
return undefined;
|
||||
throw new InlineChatError((error as Error)?.message || 'Failed to prepare session');
|
||||
}
|
||||
if (!rawSession) {
|
||||
this._logService.trace('[IE] NO session', provider.debugName);
|
||||
|
||||
Reference in New Issue
Block a user