fleetbo-cockpit-cli 1.0.7 β 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +9 -3
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -362,6 +362,12 @@ else if (command === 'android' || command === 'ios') {
|
|
|
362
362
|
process.stdout.write(`\x1b[32mOK\x1b[0m\n\n`);
|
|
363
363
|
} catch (preflightError) {
|
|
364
364
|
process.stdout.write(`\x1b[31mDENIED\x1b[0m\n`);
|
|
365
|
+
|
|
366
|
+
// π’ AJOUT CRITIQUE : On capture le message d'erreur du Cloud (JSON)
|
|
367
|
+
if (preflightError.response && preflightError.response.data && preflightError.response.data.error) {
|
|
368
|
+
// On remplace l'erreur technique Axios par le message mΓ©tier clair
|
|
369
|
+
throw new Error(preflightError.response.data.error);
|
|
370
|
+
}
|
|
365
371
|
// Fait sauter le code directement au "catch" global du bas sans jamais builder
|
|
366
372
|
throw preflightError;
|
|
367
373
|
}
|
|
@@ -423,7 +429,7 @@ else if (command === 'android' || command === 'ios') {
|
|
|
423
429
|
console.log(` \x1b[32mβ\x1b[0m Bundle ready: ${sizeMB} MB`);
|
|
424
430
|
|
|
425
431
|
// Γtape 3: Upload vers Cloud Function
|
|
426
|
-
console.log(`\n\x1b[33m[3/3]\x1b[0m Uploading to Fleetbo
|
|
432
|
+
console.log(`\n\x1b[33m[3/3]\x1b[0m Uploading to Fleetbo OS...`);
|
|
427
433
|
await showEnergyTransfer();
|
|
428
434
|
|
|
429
435
|
// π’ ON UTILISE UNE VARIABLE LOCALE POUR LA RΓPONSE
|
|
@@ -445,7 +451,7 @@ else if (command === 'android' || command === 'ios') {
|
|
|
445
451
|
throw new Error(axiosError.response.data.error);
|
|
446
452
|
} else {
|
|
447
453
|
// Timeout ou erreur rΓ©seau pure
|
|
448
|
-
throw new Error(`Connection to
|
|
454
|
+
throw new Error(`Connection to OS failed: ${axiosError.message}`);
|
|
449
455
|
}
|
|
450
456
|
}
|
|
451
457
|
|
|
@@ -455,7 +461,7 @@ else if (command === 'android' || command === 'ios') {
|
|
|
455
461
|
console.log(`\x1b[32mβ ${platform.toUpperCase()} PROPULSION SUCCESSFUL\x1b[0m`);
|
|
456
462
|
console.log(`\x1b[32mββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\x1b[0m`);
|
|
457
463
|
console.log(`\x1b[90m Deployment ID: ${uploadResponse.data.deploymentId || 'N/A'}\x1b[0m`);
|
|
458
|
-
console.log(`\x1b[90m Your ${platform} bundle is now in the
|
|
464
|
+
console.log(`\x1b[90m Your ${platform} bundle is now in the OS.\x1b[0m\n`);
|
|
459
465
|
} else {
|
|
460
466
|
// Ce cas ne devrait pas arriver si le backend est bien codΓ© (il renverrait une erreur HTTP), mais au cas oΓΉ :
|
|
461
467
|
throw new Error(uploadResponse.data?.error || 'Unknown logical error from Factory');
|