Skip to content

Commit

Permalink
Better error handling, when doing file upload
Browse files Browse the repository at this point in the history
  • Loading branch information
PicoCreator committed Jun 10, 2022
1 parent bdefe38 commit 3144b67
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions src/cli-command/project/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,23 @@ module.exports = {

// Iterate the remote file list, and await its result sequentially
for( let i=0; i<fileListResult.length; ++i ) {
// Get the respective outcome
let [fileOutcome, localRelativePath] = await fileListResult[i];

// Skip irrelevant outcomes
if( fileOutcome == false ) {
continue;
try {
// Get the respective outcome
let [fileOutcome, localRelativePath] = await fileListResult[i];

// Skip irrelevant outcomes
if( fileOutcome == false ) {
continue;
}

// Lets prepare the result output (according to the respective settings)
OutputHandler.standard(`[${fileOutcome}] ${localRelativePath}`)
OutputHandler.tableRow([fileOutcome, localRelativePath], tableWidth);
jsonResultMap[localRelativePath] = fileOutcome;
} catch(e) {
OutputHandler.errorMessage("Unexpected error happened when uploading: "+dirScanList[i]);
OutputHandler.fatalError(e, 52);
}

// Lets prepare the result output (according to the respective settings)
OutputHandler.standard(`[${fileOutcome}] ${localRelativePath}`)
OutputHandler.tableRow([fileOutcome, localRelativePath], tableWidth);
jsonResultMap[localRelativePath] = fileOutcome;
}

// Complete Handler
Expand Down

0 comments on commit 3144b67

Please sign in to comment.