more verbose error hint for s3
This commit is contained in:
parent
bfa23eb8a5
commit
af8357ba6e
@ -24,6 +24,7 @@ import { Buffer } from "buffer";
|
|||||||
import * as mime from "mime-types";
|
import * as mime from "mime-types";
|
||||||
import { Vault, requestUrl, RequestUrlParam } from "obsidian";
|
import { Vault, requestUrl, RequestUrlParam } from "obsidian";
|
||||||
import { Readable } from "stream";
|
import { Readable } from "stream";
|
||||||
|
import AggregateError from "aggregate-error";
|
||||||
import {
|
import {
|
||||||
DEFAULT_CONTENT_TYPE,
|
DEFAULT_CONTENT_TYPE,
|
||||||
RemoteItem,
|
RemoteItem,
|
||||||
@ -537,8 +538,19 @@ export const checkConnectivity = async (
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
log.debug(err);
|
log.debug(err);
|
||||||
if (callbackFunc !== undefined) {
|
if (callbackFunc !== undefined) {
|
||||||
callbackFunc(err);
|
if (s3Config.s3Endpoint.contains(s3Config.s3BucketName)) {
|
||||||
|
const err2 = new AggregateError([
|
||||||
|
err,
|
||||||
|
new Error(
|
||||||
|
"Maybe you've included the bucket name inside the endpoint setting. Please remove the bucket name and try again."
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
callbackFunc(err2);
|
||||||
|
} else {
|
||||||
|
callbackFunc(err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user