Error handling
Some errors did not cause the Action to fail
This commit is contained in:
parent
ac639ec332
commit
c901bfb72a
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
12
src/index.ts
12
src/index.ts
|
@ -34,6 +34,7 @@ const workingDir = resetWorkingDir();
|
|||
|
||||
async function run(): Promise<{ code: number, msg?: string }> {
|
||||
return new Promise(async (resolve, reject): Promise<void> => {
|
||||
try {
|
||||
if (versions.length == 0) return resolve({code: 0, msg: 'No version(s) provided to build'});
|
||||
if (target.length == 0) return resolve({code: 0, msg: 'No target(s) provided to build'});
|
||||
|
||||
|
@ -135,9 +136,14 @@ async function run(): Promise<{ code: number, msg?: string }> {
|
|||
});
|
||||
}
|
||||
|
||||
(parallelLimit(tasks, threadCount) as unknown as Promise<unknown[]>) // Valid according to docs - types outdated?
|
||||
.then(() => resolve({code: 0}))
|
||||
.catch(reject);
|
||||
parallelLimit(tasks, threadCount, ((err, results) => {
|
||||
if (err) return reject(err);
|
||||
|
||||
resolve({code: 0});
|
||||
}));
|
||||
} catch (err) {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue