@@ -94,7 +94,7 @@ function tryGetSarifResultPath(
9494 }
9595 } catch ( e ) {
9696 logger . warning (
97- `Failed to find SARIF results path for ${ language } . ${
97+ `Failed to find SARIF results path for ${ language } . Reason: ${
9898 wrapError ( e ) . message
9999 } `,
100100 ) ;
@@ -108,14 +108,22 @@ async function tryBundleDatabase(
108108 logger : Logger ,
109109) : Promise < string [ ] > {
110110 try {
111- if ( ! dbIsFinalized ( config , language , logger ) ) {
112- return [ await createPartialDatabaseBundle ( config , language ) ] ;
113- } else {
114- return [ await createDatabaseBundleCli ( config , language ) ] ;
111+ if ( dbIsFinalized ( config , language , logger ) ) {
112+ try {
113+ return [ await createDatabaseBundleCli ( config , language ) ] ;
114+ } catch ( e ) {
115+ logger . warning (
116+ `Failed to bundle database for ${ language } using the CLI. ` +
117+ `Falling back to a partial bundle. Reason: ${ wrapError ( e ) . message } ` ,
118+ ) ;
119+ }
115120 }
121+ return [ await createPartialDatabaseBundle ( config , language ) ] ;
116122 } catch ( e ) {
117123 logger . warning (
118- `Failed to bundle database for ${ language } . ${ wrapError ( e ) . message } ` ,
124+ `Failed to bundle database for ${ language } . Reason: ${
125+ wrapError ( e ) . message
126+ } `,
119127 ) ;
120128 return [ ] ;
121129 }
@@ -159,7 +167,9 @@ export async function uploadAllAvailableDebugArtifacts(
159167 config . debugArtifactName ,
160168 ) ;
161169 } catch ( e ) {
162- logger . warning ( `Failed to upload debug artifacts: ${ wrapError ( e ) . message } ` ) ;
170+ logger . warning (
171+ `Failed to upload debug artifacts. Reason: ${ wrapError ( e ) . message } ` ,
172+ ) ;
163173 }
164174}
165175
@@ -199,7 +209,9 @@ export async function uploadDebugArtifacts(
199209 ) ;
200210 } catch ( e ) {
201211 // A failure to upload debug artifacts should not fail the entire action.
202- core . warning ( `Failed to upload debug artifacts: ${ e } ` ) ;
212+ core . warning (
213+ `Failed to upload debug artifacts. Reason: ${ wrapError ( e ) . message } ` ,
214+ ) ;
203215 }
204216}
205217
@@ -237,7 +249,6 @@ async function createDatabaseBundleCli(
237249 config : Config ,
238250 language : Language ,
239251) : Promise < string > {
240- // Otherwise run `codeql database bundle` command.
241252 const databaseBundlePath = await bundleDb (
242253 config ,
243254 language ,
0 commit comments