mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 11:59:12 +03:00
Improve 404 handling
This commit is contained in:
parent
1976451c81
commit
eb30ef166a
1 changed files with 4 additions and 1 deletions
|
@ -75,7 +75,9 @@ class SimpleHttpRendezvousTransport(override var onCancelled: ((reason: Rendezvo
|
||||||
val response = httpClient.newCall(request.build()).execute()
|
val response = httpClient.newCall(request.build()).execute()
|
||||||
|
|
||||||
if (response.code == 404) {
|
if (response.code == 404) {
|
||||||
|
// we set to unknown and the cancel method will rewrite the reason to expired if applicable
|
||||||
cancel(RendezvousFailureReason.Unknown)
|
cancel(RendezvousFailureReason.Unknown)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
etag = response.header("etag")
|
etag = response.header("etag")
|
||||||
|
|
||||||
|
@ -116,7 +118,8 @@ class SimpleHttpRendezvousTransport(override var onCancelled: ((reason: Rendezvo
|
||||||
try {
|
try {
|
||||||
// expired
|
// expired
|
||||||
if (response.code == 404) {
|
if (response.code == 404) {
|
||||||
cancel(RendezvousFailureReason.Expired)
|
// we set to unknown and the cancel method will rewrite the reason to expired if applicable
|
||||||
|
cancel(RendezvousFailureReason.Unknown)
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue