3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2025-04-05 21:24:07 +00:00

Improve diagnostics: show exception stack trace (#63)

Also add logging to the quiet exception handlers.
This commit is contained in:
Vlad-Shcherbina 2022-06-25 23:20:01 +02:00 committed by GitHub
parent cb2cf0cc7c
commit 2055a01dcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 6 deletions

View file

@ -45,7 +45,7 @@ async function run() {
} catch (e) { } catch (e) {
setCacheHitOutput(false); setCacheHitOutput(false);
core.info(`[warning] ${(e as any).message}`); core.info(`[warning] ${(e as any).stack}`);
} }
} }

View file

@ -38,26 +38,34 @@ async function run() {
try { try {
await cleanRegistry(registryName, packages); await cleanRegistry(registryName, packages);
} catch {} } catch (e) {
core.info(`[warning] ${(e as any).stack}`);
}
try { try {
await cleanBin(); await cleanBin();
} catch {} } catch (e) {
core.info(`[warning] ${(e as any).stack}`);
}
try { try {
await cleanGit(packages); await cleanGit(packages);
} catch {} } catch (e) {
core.info(`[warning] ${(e as any).stack}`);
}
try { try {
await cleanTarget(packages); await cleanTarget(packages);
} catch {} } catch (e) {
core.info(`[warning] ${(e as any).stack}`);
}
core.info(`Saving paths:\n ${savePaths.join("\n ")}`); core.info(`Saving paths:\n ${savePaths.join("\n ")}`);
core.info(`In directory:\n ${process.cwd()}`); core.info(`In directory:\n ${process.cwd()}`);
core.info(`Using key:\n ${key}`); core.info(`Using key:\n ${key}`);
await cache.saveCache(savePaths, key); await cache.saveCache(savePaths, key);
} catch (e) { } catch (e) {
core.info(`[warning] ${(e as any).message}`); core.info(`[warning] ${(e as any).stack}`);
} }
} }