Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/commands/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,8 @@ export async function compile(docs: (CurrentTextFile | CurrentBinaryFile)[], ask
}
return docs;
})
.catch(() => {
compileErrorMsg();
.catch((error) => {
compileErrorMsg(error);
// Always fetch server changes, even when compile failed or got cancelled
return docs;
})
Expand Down Expand Up @@ -550,7 +550,7 @@ export async function compileExplorerItems(nodes: NodeBase[]): Promise<any> {
throw new Error(`${info}Compile error`);
}
})
.catch(() => compileErrorMsg())
.catch((error) => compileErrorMsg(error))
);
}

Expand Down Expand Up @@ -637,7 +637,7 @@ async function promptForCompile(imported: string[], api: AtelierAPI, isIsfs: boo
throw new Error(`${info}Compile error`);
}
})
.catch(() => compileErrorMsg())
.catch((error) => compileErrorMsg(error))
.finally(() => {
if (isIsfs) {
// Refresh the files explorer to show the new files
Expand Down
2 changes: 1 addition & 1 deletion src/providers/FileSystemProvider/FileSystemProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
}
data.result.content.forEach((f) => filesToUpdate.push(f.name));
})
.catch(() => compileErrorMsg())
.catch((error) => compileErrorMsg(error))
);
if (file && (update || filesToUpdate.includes(file.fileName))) {
// This file was just written and the write may have changed its contents or the
Expand Down
15 changes: 13 additions & 2 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,23 @@
return errs.length ? `AggregateError:\n- ${errs.join("\n- ")}` : "";
}
return (
error == undefined

Check failure on line 66 in src/utils/index.ts

View workflow job for this annotation

GitHub Actions / build

Insert `(⏎········`
? ""

Check failure on line 67 in src/utils/index.ts

View workflow job for this annotation

GitHub Actions / build

Insert `··`
: error.errorText

Check failure on line 68 in src/utils/index.ts

View workflow job for this annotation

GitHub Actions / build

Insert `··`
? <string>error.errorText

Check failure on line 69 in src/utils/index.ts

View workflow job for this annotation

GitHub Actions / build

Insert `··`
: typeof error == "string"

Check failure on line 70 in src/utils/index.ts

View workflow job for this annotation

GitHub Actions / build

Insert `··`
? error

Check failure on line 71 in src/utils/index.ts

View workflow job for this annotation

GitHub Actions / build

Insert `··`
: error instanceof Error

Check failure on line 72 in src/utils/index.ts

View workflow job for this annotation

GitHub Actions / build

Insert `··`
? error.toString()

Check failure on line 73 in src/utils/index.ts

View workflow job for this annotation

GitHub Actions / build

Insert `··`
: JSON.stringify(error)

Check failure on line 74 in src/utils/index.ts

View workflow job for this annotation

GitHub Actions / build

Insert `··`
).trim();
)

Check failure on line 75 in src/utils/index.ts

View workflow job for this annotation

GitHub Actions / build

Insert `··`
.trim()
// Unescape any HTML-escpaed characters
.replaceAll("&amp;", "&")
.replaceAll("&lt;", "<")
.replaceAll("&gt;", ">")
.replaceAll("&quot;", '"')
.replaceAll("&#39;", "'");
} catch {
// Need to catch errors from JSON.stringify()
return "";
Expand Down Expand Up @@ -1017,7 +1024,11 @@
}

/** Show the compilation failure error message if required. */
export function compileErrorMsg(): void {
export function compileErrorMsg(error: any): void {
if (!(error instanceof Error && error.message.endsWith("Compile error"))) {
// Don't log the generic placeholder error
handleError(error);
Comment thread
isc-bsaviano marked this conversation as resolved.
Outdated
}
vscode.window
.showErrorMessage(
"Compilation failed. Check 'ObjectScript' Output channel for details.",
Expand Down
Loading