Include mkdirSync in try/catch
This commit is contained in:
parent
a144bf5d7f
commit
3b2fee487e
3 changed files with 12 additions and 12 deletions
|
|
@ -93,15 +93,15 @@ export function addDiagnostic(
|
|||
"codeql-action",
|
||||
);
|
||||
|
||||
// Create the directory if it doesn't exist yet.
|
||||
mkdirSync(diagnosticsPath, { recursive: true });
|
||||
|
||||
const jsonPath = path.resolve(
|
||||
diagnosticsPath,
|
||||
`codeql-action-${diagnostic.timestamp}.json`,
|
||||
);
|
||||
|
||||
try {
|
||||
// Create the directory if it doesn't exist yet.
|
||||
mkdirSync(diagnosticsPath, { recursive: true });
|
||||
|
||||
const jsonPath = path.resolve(
|
||||
diagnosticsPath,
|
||||
`codeql-action-${diagnostic.timestamp}.json`,
|
||||
);
|
||||
|
||||
writeFileSync(jsonPath, JSON.stringify(diagnostic));
|
||||
} catch (err) {
|
||||
logger.warning(`Unable to write diagnostic message to database: ${err}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue