1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Desktop: Fixes #5875: Show error on sync if S3 region is not set (#5923)

This commit is contained in:
Shing Lyu 2022-01-09 12:24:24 +01:00 committed by GitHub
parent 3dfe43204d
commit 9684b38f7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 9 deletions

View File

@ -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(

View File

@ -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';
}

View File

@ -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';
}