@@ -97,21 +97,23 @@ function isSystemError(err: Error, expectedCode: string): boolean | undefined {
9797}
9898
9999// Return true if the given error is ENOENT.
100- export function isFileNotFoundError ( err : Error ) : boolean | undefined {
101- const matched = vscErrors . isFileNotFound ( err ) ;
100+ export function isFileNotFoundError ( err : unknown | Error ) : boolean | undefined {
101+ const error = err as Error ;
102+ const matched = vscErrors . isFileNotFound ( error ) ;
102103 if ( matched !== undefined ) {
103104 return matched ;
104105 }
105- return isSystemError ( err , 'ENOENT' ) ;
106+ return isSystemError ( error , 'ENOENT' ) ;
106107}
107108
108109// Return true if the given error is EEXIST.
109- export function isFileExistsError ( err : Error ) : boolean | undefined {
110- const matched = vscErrors . isFileExists ( err ) ;
110+ export function isFileExistsError ( err : unknown | Error ) : boolean | undefined {
111+ const error = err as Error ;
112+ const matched = vscErrors . isFileExists ( error ) ;
111113 if ( matched !== undefined ) {
112114 return matched ;
113115 }
114- return isSystemError ( err , 'EEXIST' ) ;
116+ return isSystemError ( error , 'EEXIST' ) ;
115117}
116118
117119// Return true if the given error is EISDIR.
@@ -133,10 +135,11 @@ export function isNotDirError(err: Error): boolean | undefined {
133135}
134136
135137// Return true if the given error is EACCES.
136- export function isNoPermissionsError ( err : Error ) : boolean | undefined {
137- const matched = vscErrors . isNoPermissions ( err ) ;
138+ export function isNoPermissionsError ( err : unknown | Error ) : boolean | undefined {
139+ const error = err as Error ;
140+ const matched = vscErrors . isNoPermissions ( error ) ;
138141 if ( matched !== undefined ) {
139142 return matched ;
140143 }
141- return isSystemError ( err , 'EACCES' ) ;
144+ return isSystemError ( error , 'EACCES' ) ;
142145}
0 commit comments