-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vCard error response is not passed back to application as an event #9
Comments
Also, on the
It would be useful here to have some more context with the error message. |
I added few tests, and for me it works correctly. Every time error response is correctly handled. Also exception during mapping response is correctly converted to Response Failure. |
Ok, in such a case how can I get the exact error from the response? My code is like this: vcardModule.retrieveVCard(jid).response { result ->
result.onSuccess { vcard ->
println("Received public vcard for $jid")
handleVCardEvent(VCardUpdatedEvent(jid, vcard))
}
result.onFailure {
println("Problem retrieving vCard for ${jid}, ${result.exceptionOrNull()}")
}
}.send() And all I get in the last
And the problem here is that this XMPPError does not say much. Whether the server no longer exists or something else. It would be useful to have more detailed information of why there was failure. |
Obtaining error details is common in Halcyon, because vcardModule.retrieveVCard(jid).response { result ->
result.onSuccess { vcard ->
println("Received public vcard for $jid")
handleVCardEvent(VCardUpdatedEvent(jid, vcard))
}
result.onFailure {
when (it) {
is tigase.halcyon.core.requests.XMPPError -> println("XMPP Error response: condition=${it.error}; text=${it.description}; responseStanza=${it.response}")
else -> {
println("Other error: $it")
it.printStackTrace()
}
}
}
}.send() |
I am attempting to retrieve contact's vcard as described in the issue: #6 (comment)
For some vcard request I am getting responses like this:
Request:
Response:
In the library log I can see that the response was not correctly handler:
There is an event fired
ReceivedXMLElementEvent
but it is not really useful in the application space. It would be bette to receive an error event in response to the vcard IQRequest.The text was updated successfully, but these errors were encountered: