diff --git a/packages/lib/SyncTargetAmazonS3.js b/packages/lib/SyncTargetAmazonS3.js index 4f8f78a1c..9363cebf2 100644 --- a/packages/lib/SyncTargetAmazonS3.js +++ b/packages/lib/SyncTargetAmazonS3.js @@ -98,14 +98,14 @@ class SyncTargetAmazonS3 extends BaseSyncTarget { // We could implement that here, but the above workaround saves some code. static async checkConfig(options) { - const fileApi = await SyncTargetAmazonS3.newFileApi_(SyncTargetAmazonS3.id(), options); - fileApi.requestRepeatCount_ = 0; - const output = { ok: false, errorMessage: '', }; try { + const fileApi = await SyncTargetAmazonS3.newFileApi_(SyncTargetAmazonS3.id(), options); + fileApi.requestRepeatCount_ = 0; + const headBucketReq = new Promise((resolve, reject) => { fileApi.driver().api().send( diff --git a/packages/lib/commands/synchronize.ts b/packages/lib/commands/synchronize.ts index 3ebcd70e3..c878a2639 100644 --- a/packages/lib/commands/synchronize.ts +++ b/packages/lib/commands/synchronize.ts @@ -35,7 +35,7 @@ export const runtime = (): CommandRuntime => { return 'auth'; } - reg.logger().info('Not authentified with sync target - please check your credential.'); + reg.logger().error('Not authenticated with sync target - please check your credentials.'); return 'error'; } @@ -43,8 +43,13 @@ export const runtime = (): CommandRuntime => { try { sync = await reg.syncTarget().synchronizer(); } catch (error) { - reg.logger().info('Could not acquire synchroniser:'); - reg.logger().info(error); + reg.logger().error('Could not initialise synchroniser: '); + reg.logger().error(error); + error.message = `Could not initialise synchroniser: ${error.message}`; + utils.store.dispatch({ + type: 'SYNC_REPORT_UPDATE', + report: { errors: [error] }, + }); return 'error'; } diff --git a/packages/lib/components/shared/side-menu-shared.js b/packages/lib/components/shared/side-menu-shared.js index 94f8cda69..9e8a2548e 100644 --- a/packages/lib/components/shared/side-menu-shared.js +++ b/packages/lib/components/shared/side-menu-shared.js @@ -105,7 +105,7 @@ shared.synchronize_press = async function(comp) { return 'auth'; } - reg.logger().info('Not authentified with sync target - please check your credential.'); + reg.logger().error('Not authenticated with sync target - please check your credentials.'); return 'error'; } @@ -113,8 +113,13 @@ shared.synchronize_press = async function(comp) { try { sync = await reg.syncTarget().synchronizer(); } catch (error) { - reg.logger().info('Could not acquire synchroniser:'); - reg.logger().info(error); + reg.logger().error('Could not initialise synchroniser: '); + reg.logger().error(error); + error.message = `Could not initialise synchroniser: ${error.message}`; + comp.props.dispatch({ + type: 'SYNC_REPORT_UPDATE', + report: { errors: [error] }, + }); return 'error'; }