a bit more jsdoc, #47475

This commit is contained in:
Johannes Rieken
2018-04-23 12:03:04 +02:00
parent d2c4286669
commit 2bf25467ad
2 changed files with 51 additions and 19 deletions

View File

@@ -1834,26 +1834,26 @@ export enum FileType {
export class FileSystemError extends Error {
static EntryExists(message?: string): FileSystemError {
return new FileSystemError(message, 'EntryExists', FileSystemError.EntryExists);
static EntryExists(messageOrUri?: string | URI): FileSystemError {
return new FileSystemError(messageOrUri, 'EntryExists', FileSystemError.EntryExists);
}
static EntryNotFound(message?: string): FileSystemError {
return new FileSystemError(message, 'EntryNotFound', FileSystemError.EntryNotFound);
static EntryNotFound(messageOrUri?: string | URI): FileSystemError {
return new FileSystemError(messageOrUri, 'EntryNotFound', FileSystemError.EntryNotFound);
}
static EntryNotADirectory(message?: string): FileSystemError {
return new FileSystemError(message, 'EntryNotADirectory', FileSystemError.EntryNotADirectory);
static EntryNotADirectory(messageOrUri?: string | URI): FileSystemError {
return new FileSystemError(messageOrUri, 'EntryNotADirectory', FileSystemError.EntryNotADirectory);
}
static EntryIsADirectory(message?: string): FileSystemError {
return new FileSystemError(message, 'EntryIsADirectory', FileSystemError.EntryIsADirectory);
static EntryIsADirectory(messageOrUri?: string | URI): FileSystemError {
return new FileSystemError(messageOrUri, 'EntryIsADirectory', FileSystemError.EntryIsADirectory);
}
constructor(message?: string, code?: string, hide?: Function) {
super(message);
constructor(uriOrMessage?: string | URI, code?: string, terminator?: Function) {
super(URI.isUri(uriOrMessage) ? uriOrMessage.toString(true) : uriOrMessage);
this.name = code ? `${code} (FileSystemError)` : `FileSystemError`;
if (typeof Error.captureStackTrace === 'function' && typeof hide === 'function') {
if (typeof Error.captureStackTrace === 'function' && typeof terminator === 'function') {
// nice stack traces
Error.captureStackTrace(this, hide);
Error.captureStackTrace(this, terminator);
}
}
}