@@ -1022,6 +1022,7 @@ const pushFunction = async ({ functionId, async, code, withVariables } = { retur
1022
1022
let successfullyPushed = 0;
1023
1023
let successfullyDeployed = 0;
1024
1024
const failedDeployments = [];
1025
+ const errors = [];
1025
1026
1026
1027
await Promise.all(functions.map(async (func) => {
1027
1028
let response = {};
@@ -1071,6 +1072,7 @@ const pushFunction = async ({ functionId, async, code, withVariables } = { retur
1071
1072
if (Number(e.code) === 404) {
1072
1073
functionExists = false;
1073
1074
} else {
1075
+ errors.push(e);
1074
1076
updaterRow.fail({ errorMessage: e.message ?? 'General error occurs please try again' });
1075
1077
return;
1076
1078
}
@@ -1098,6 +1100,7 @@ const pushFunction = async ({ functionId, async, code, withVariables } = { retur
1098
1100
1099
1101
updaterRow.update({ status: 'Created' });
1100
1102
} catch (e) {
1103
+ errors.push(e)
1101
1104
updaterRow.fail({ errorMessage: e.message ?? 'General error occurs please try again' });
1102
1105
return;
1103
1106
}
@@ -1159,6 +1162,8 @@ const pushFunction = async ({ functionId, async, code, withVariables } = { retur
1159
1162
deploymentCreated = true;
1160
1163
successfullyPushed++;
1161
1164
} catch (e) {
1165
+ errors.push(e);
1166
+
1162
1167
switch (e.code) {
1163
1168
case 'ENOENT':
1164
1169
updaterRow.fail({ errorMessage: 'Not found in the current directory. Skipping...' })
@@ -1216,6 +1221,7 @@ const pushFunction = async ({ functionId, async, code, withVariables } = { retur
1216
1221
await new Promise(resolve => setTimeout(resolve, POLL_DEBOUNCE * 1.5));
1217
1222
}
1218
1223
} catch (e) {
1224
+ errors.push(e);
1219
1225
updaterRow.fail({ errorMessage: e.message ?? 'Unknown error occurred. Please try again' })
1220
1226
}
1221
1227
}
@@ -1243,6 +1249,12 @@ const pushFunction = async ({ functionId, async, code, withVariables } = { retur
1243
1249
} else {
1244
1250
success(`Successfully pushed ${successfullyPushed} functions.`);
1245
1251
}
1252
+
1253
+ if (cliConfig.verbose) {
1254
+ errors.forEach(e => {
1255
+ console.error(e);
1256
+ })
1257
+ }
1246
1258
}
1247
1259
1248
1260
const pushCollection = async ({ returnOnZero, attempts } = { returnOnZero: false }) => {
0 commit comments