@@ -94,7 +94,7 @@ function tryGetSarifResultPath(
94
94
}
95
95
} catch ( e ) {
96
96
logger . warning (
97
- `Failed to find SARIF results path for ${ language } . ${
97
+ `Failed to find SARIF results path for ${ language } . Reason: ${
98
98
wrapError ( e ) . message
99
99
} `,
100
100
) ;
@@ -108,14 +108,22 @@ async function tryBundleDatabase(
108
108
logger : Logger ,
109
109
) : Promise < string [ ] > {
110
110
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
+ }
115
120
}
121
+ return [ await createPartialDatabaseBundle ( config , language ) ] ;
116
122
} catch ( e ) {
117
123
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
+ } `,
119
127
) ;
120
128
return [ ] ;
121
129
}
@@ -159,7 +167,9 @@ export async function uploadAllAvailableDebugArtifacts(
159
167
config . debugArtifactName ,
160
168
) ;
161
169
} 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
+ ) ;
163
173
}
164
174
}
165
175
@@ -199,7 +209,9 @@ export async function uploadDebugArtifacts(
199
209
) ;
200
210
} catch ( e ) {
201
211
// 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
+ ) ;
203
215
}
204
216
}
205
217
@@ -237,7 +249,6 @@ async function createDatabaseBundleCli(
237
249
config : Config ,
238
250
language : Language ,
239
251
) : Promise < string > {
240
- // Otherwise run `codeql database bundle` command.
241
252
const databaseBundlePath = await bundleDb (
242
253
config ,
243
254
language ,
0 commit comments