@@ -94,7 +94,9 @@ function tryGetSarifResultPath(
94
94
}
95
95
} catch ( e ) {
96
96
logger . warning (
97
- `Failed to find SARIF results path for ${ language } . ${ wrapError ( e ) } ` ,
97
+ `Failed to find SARIF results path for ${ language } . ${
98
+ wrapError ( e ) . message
99
+ } `,
98
100
) ;
99
101
}
100
102
return [ ] ;
@@ -113,7 +115,7 @@ async function tryBundleDatabase(
113
115
}
114
116
} catch ( e ) {
115
117
logger . warning (
116
- `Failed to bundle database for ${ language } . ${ wrapError ( e ) } ` ,
118
+ `Failed to bundle database for ${ language } . ${ wrapError ( e ) . message } ` ,
117
119
) ;
118
120
return [ ] ;
119
121
}
@@ -123,36 +125,42 @@ export async function uploadAllAvailableDebugArtifacts(
123
125
config : Config ,
124
126
logger : Logger ,
125
127
) {
126
- const filesToUpload : string [ ] = [ ] ;
128
+ try {
129
+ const filesToUpload : string [ ] = [ ] ;
130
+
131
+ for ( const language of config . languages ) {
132
+ filesToUpload . push ( ...tryGetSarifResultPath ( config , language , logger ) ) ;
127
133
128
- for ( const language of config . languages ) {
129
- filesToUpload . push ( ...tryGetSarifResultPath ( config , language , logger ) ) ;
134
+ // Add any log files
135
+ const databaseDirectory = getCodeQLDatabasePath ( config , language ) ;
136
+ const logsDirectory = path . resolve ( databaseDirectory , "log" ) ;
137
+ if ( doesDirectoryExist ( logsDirectory ) ) {
138
+ filesToUpload . push ( ...listFolder ( logsDirectory ) ) ;
139
+ }
130
140
131
- // Add any log files
132
- const databaseDirectory = getCodeQLDatabasePath ( config , language ) ;
133
- const logsDirectory = path . resolve ( databaseDirectory , "log" ) ;
134
- if ( doesDirectoryExist ( logsDirectory ) ) {
135
- filesToUpload . push ( ...listFolder ( logsDirectory ) ) ;
141
+ // Multilanguage tracing: there are additional logs in the root of the cluster
142
+ const multiLanguageTracingLogsDirectory = path . resolve (
143
+ config . dbLocation ,
144
+ "log" ,
145
+ ) ;
146
+ if ( doesDirectoryExist ( multiLanguageTracingLogsDirectory ) ) {
147
+ filesToUpload . push ( ...listFolder ( multiLanguageTracingLogsDirectory ) ) ;
148
+ }
149
+
150
+ // Add database bundle
151
+ filesToUpload . push (
152
+ ...( await tryBundleDatabase ( config , language , logger ) ) ,
153
+ ) ;
136
154
}
137
155
138
- // Multilanguage tracing: there are additional logs in the root of the cluster
139
- const multiLanguageTracingLogsDirectory = path . resolve (
156
+ await uploadDebugArtifacts (
157
+ filesToUpload ,
140
158
config . dbLocation ,
141
- "log" ,
159
+ config . debugArtifactName ,
142
160
) ;
143
- if ( doesDirectoryExist ( multiLanguageTracingLogsDirectory ) ) {
144
- filesToUpload . push ( ...listFolder ( multiLanguageTracingLogsDirectory ) ) ;
145
- }
146
-
147
- // Add database bundle
148
- filesToUpload . push ( ...( await tryBundleDatabase ( config , language , logger ) ) ) ;
161
+ } catch ( e ) {
162
+ logger . warning ( `Failed to upload debug artifacts: ${ wrapError ( e ) . message } ` ) ;
149
163
}
150
-
151
- await uploadDebugArtifacts (
152
- filesToUpload ,
153
- config . dbLocation ,
154
- config . debugArtifactName ,
155
- ) ;
156
164
}
157
165
158
166
export async function uploadDebugArtifacts (
0 commit comments