This commit is contained in:
Benjamin Pasero
2019-03-26 08:38:37 +01:00
parent 966b87dd40
commit d0211faa28
3 changed files with 14 additions and 11 deletions

View File

@@ -2206,12 +2206,12 @@ export class FileSystemError extends Error {
return new FileSystemError(messageOrUri, FileSystemProviderErrorCode.Unavailable, FileSystemError.Unavailable);
}
constructor(uriOrMessage?: string | URI, code?: string, terminator?: Function) {
constructor(uriOrMessage?: string | URI, code: FileSystemProviderErrorCode = FileSystemProviderErrorCode.Unknown, terminator?: Function) {
super(URI.isUri(uriOrMessage) ? uriOrMessage.toString(true) : uriOrMessage);
// mark the error as file system provider error so that
// we can extract the error code on the receiving side
markAsFileSystemProviderError(this);
markAsFileSystemProviderError(this, code);
// workaround when extending builtin objects and when compiling to ES5, see:
// https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work