@@ -9,12 +9,14 @@ import { CLI } from '../cli/CLI';
99import { TreeItemCache } from './TreeItemCache' ;
1010import type { ProjectFile } from '../types/ProjectFile' ;
1111import { getCommandsConfig } from '../config/config' ;
12+ import type { Logger } from '../util/Logger' ;
1213
1314export const projectsCache = new TreeItemCache < DbContextTreeItem [ ] > ( ) ;
1415
1516export class ProjectTreeItem extends TreeItem {
1617 private readonly cacheId : string ;
1718 constructor (
19+ private readonly logger : Logger ,
1820 public readonly label : string ,
1921 private readonly projectFile : ProjectFile ,
2022 private readonly cli : CLI ,
@@ -59,6 +61,7 @@ export class ProjectTreeItem extends TreeItem {
5961 const children = dbContexts . map (
6062 dbContext =>
6163 new DbContextTreeItem (
64+ this . logger ,
6265 dbContext . name ,
6366 this . projectFile ,
6467 project ,
@@ -69,9 +72,9 @@ export class ProjectTreeItem extends TreeItem {
6972 projectsCache . set ( this . cacheId , children ) ;
7073 return children ;
7174 } catch ( e ) {
72- await vscode . window . showErrorMessage (
73- `Unable to get dbContexts: ${ ( e as Error ) . message } ` ,
74- ) ;
75+ const msg = `Unable to get dbContexts: ${ ( e as Error ) . message } ` . trim ( ) ;
76+ this . logger . error ( msg ) ;
77+ await vscode . window . showErrorMessage ( msg , 'OK' ) ;
7578 return [ ] ;
7679 }
7780 }
0 commit comments