Skip to content

Commit

Permalink
Merge pull request #2363 from github/henrymercer/better-error-handling
Browse files Browse the repository at this point in the history
Improve error handling
  • Loading branch information
henrymercer committed Jul 8, 2024
2 parents 7adf9ac + 01bde73 commit 064a406
Show file tree
Hide file tree
Showing 12 changed files with 85 additions and 58 deletions.
10 changes: 3 additions & 7 deletions lib/analyze-action.js

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

2 changes: 1 addition & 1 deletion lib/analyze-action.js.map

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions lib/analyze.js

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

2 changes: 1 addition & 1 deletion lib/analyze.js.map

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions lib/cli-errors.js

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

2 changes: 1 addition & 1 deletion lib/cli-errors.js.map

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

19 changes: 19 additions & 0 deletions lib/codeql.test.js

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

2 changes: 1 addition & 1 deletion lib/codeql.test.js.map

Large diffs are not rendered by default.

40 changes: 13 additions & 27 deletions src/analyze-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,33 +356,19 @@ async function run() {
core.setFailed(error.message);
}

if (error instanceof CodeQLAnalysisError) {
const stats = { ...error.queriesStatusReport };
await sendStatusReport(
startedAt,
config,
stats,
error,
trapCacheUploadTime,
dbCreationTimings,
didUploadTrapCaches,
trapCacheCleanupTelemetry,
logger,
);
} else {
await sendStatusReport(
startedAt,
config,
undefined,
error,
trapCacheUploadTime,
dbCreationTimings,
didUploadTrapCaches,
trapCacheCleanupTelemetry,
logger,
);
}

await sendStatusReport(
startedAt,
config,
error instanceof CodeQLAnalysisError
? error.queriesStatusReport
: undefined,
error instanceof CodeQLAnalysisError ? error.error : error,
trapCacheUploadTime,
dbCreationTimings,
didUploadTrapCaches,
trapCacheCleanupTelemetry,
logger,
);
return;
}

Expand Down
Loading

0 comments on commit 064a406

Please sign in to comment.