CalDav throw error If a user tries to connect an unsupported server. (#17363)
Legacy CalDav servers don't support `syncCollection` which is required to store a `syncCursor` this PR updates the code to let user know we don't support their server. Source: https://github.com/natelindev/tsdav/blob/main/src/collection.ts#L193-L194
This commit is contained in:
+8
@@ -128,11 +128,19 @@ export class ImapSmtpCaldavService {
|
||||
|
||||
try {
|
||||
await client.listCalendars();
|
||||
await client.validateSyncCollectionSupport();
|
||||
} catch (error) {
|
||||
this.logger.error(
|
||||
`CALDAV connection failed: ${error.message}`,
|
||||
error.stack,
|
||||
);
|
||||
|
||||
if (error.message?.includes('CALDAV_SYNC_COLLECTION_NOT_SUPPORTED')) {
|
||||
throw new UserInputError(`CALDAV connection failed: ${error.message}`, {
|
||||
userFriendlyMessage: msg`Your CalDAV server does not support incremental sync (RFC 6578). Please use a compatible provider such as Nextcloud, iCloud, or Fastmail.`,
|
||||
});
|
||||
}
|
||||
|
||||
if (error.code === 'FailedToOpenSocket') {
|
||||
throw new UserInputError(`CALDAV connection failed: ${error.message}`, {
|
||||
userFriendlyMessage: msg`We couldn't connect to your CalDAV server. Please check your server settings and try again.`,
|
||||
|
||||
Reference in New Issue
Block a user