Skip to content

Commit

Permalink
Print some error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Sep 24, 2024
1 parent 14d8694 commit 263008f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
19 changes: 15 additions & 4 deletions kmake/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,14 @@ async function exportProject(from: string, to: string, platform: string, korefil
}
}

class RunError {
code: number;

constructor(code: number) {
this.code = code;
}
}

function compileProject(make: child_process.ChildProcess, project: Project, solutionName: string, options: any, dothemath: boolean): Promise<void> {
const startDate = new Date();
return new Promise<void>((resolve, reject) => {
Expand Down Expand Up @@ -772,7 +780,7 @@ function compileProject(make: child_process.ChildProcess, project: Project, solu
resolve();
}
else {
reject(code);
reject(new RunError(code));
}
});
}
Expand All @@ -783,13 +791,13 @@ function compileProject(make: child_process.ChildProcess, project: Project, solu
resolve();
}
else {
reject(code);
reject(new RunError(code));
}
});
}
else {
log.info('--run not yet implemented for this platform');
reject(1);
reject(new RunError(1));
}
}
else {
Expand Down Expand Up @@ -1083,7 +1091,10 @@ export async function run(options: any, loglog: any): Promise<string> {
}
catch (err) {
if (typeof(err) === 'number') {
throw 'Compile error';
throw 'Compile error (code ' + err + ')';
}
else if (err instanceof RunError) {
throw 'Run Error (code ' + err.code + ')';
}
else {
throw 'Compiler not found';
Expand Down
16 changes: 12 additions & 4 deletions lib/kmake/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 263008f

Please sign in to comment.