Include pending contact id in error response

This commit is contained in:
Nico Alt
2021-02-19 12:00:00 +00:00
parent d095ba0b15
commit 3e7e37f5f6
4 changed files with 10 additions and 2 deletions

View File

@@ -117,8 +117,11 @@ constructor(
return ctx.json(details)
} catch (e: PendingContactExistsException) {
ctx.status(FORBIDDEN_403)
val details =
mapOf("error" to "PENDING_EXISTS", "pendingContactAlias" to e.pendingContact.alias)
val details = mapOf(
"error" to "PENDING_EXISTS",
"pendingContactId" to e.pendingContact.id.bytes,
"pendingContactAlias" to e.pendingContact.alias
)
return ctx.json(details)
}
return ctx.json(pendingContact.output())