Skip to content
Snippets Groups Projects
Unverified Commit 8df69b1a authored by Christoph Wurst's avatar Christoph Wurst Committed by GitHub
Browse files

Merge pull request #2618 from nextcloud/fix/js-error-type-name-production

Fix error matching in production build
parents 2e44340d fcd8864f
No related branches found
No related tags found
No related merge requests found
...@@ -168,14 +168,14 @@ export default { ...@@ -168,14 +168,14 @@ export default {
} }
} catch (error) { } catch (error) {
await matchError(error, { await matchError(error, {
[MailboxLockedError.name]: async error => { [MailboxLockedError.getName()]: async error => {
logger.info('Mailbox is locked', {error}) logger.info('Mailbox is locked', {error})
await wait(15 * 1000) await wait(15 * 1000)
// Keep trying // Keep trying
await this.loadEnvelopes() await this.loadEnvelopes()
}, },
[MailboxNotCachedError.name]: async error => { [MailboxNotCachedError.getName()]: async error => {
logger.info('Mailbox not cached. Triggering initialization', {error}) logger.info('Mailbox not cached. Triggering initialization', {error})
this.loadingEnvelopes = false this.loadingEnvelopes = false
......
...@@ -22,7 +22,11 @@ ...@@ -22,7 +22,11 @@
export default class MailboxLockedError extends Error { export default class MailboxLockedError extends Error {
constructor(message) { constructor(message) {
super(message) super(message)
this.name = 'MailboxLockedError' this.name = MailboxLockedError.getName()
this.message = message this.message = message
} }
static getName() {
return 'MailboxLockedError'
}
} }
...@@ -22,7 +22,11 @@ ...@@ -22,7 +22,11 @@
export default class MailboxNotCachedError extends Error { export default class MailboxNotCachedError extends Error {
constructor(message) { constructor(message) {
super(message) super(message)
this.name = 'MailboxNotCachedError' this.name = MailboxNotCachedError.getName()
this.message = message this.message = message
} }
static getName() {
return 'MailboxNotCachedError'
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment