From 1810a474a204ff937e01d0bcc3d712b7add25387 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Wed, 22 Apr 2026 00:00:01 +0200 Subject: [PATCH] fix: enhance error message for mailbox creation failure --- lib/jmap/client.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/jmap/client.ts b/lib/jmap/client.ts index ac90a057..0a0685e7 100644 --- a/lib/jmap/client.ts +++ b/lib/jmap/client.ts @@ -1316,7 +1316,13 @@ export class JMAPClient implements IJMAPClient { const result = response.methodResponses?.[0]?.[1]; if (result?.notCreated?.[createId]) { - throw new Error(`Failed to create mailbox: ${result.notCreated[createId].type || 'unknown error'}`); + const err = result.notCreated[createId]; + const details = [err.type || 'unknown error']; + if (Array.isArray(err.properties) && err.properties.length > 0) { + details.push(`properties=[${err.properties.join(', ')}]`); + } + if (err.description) details.push(err.description); + throw new Error(`Failed to create mailbox: ${details.join(' — ')}`); } const created = result?.created?.[createId];