mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-26 11:58:51 +02:00
Reduces errors when trying to parse unparseable NIP-11s
This commit is contained in:
@@ -175,7 +175,11 @@ class Nip11Retriever {
|
||||
val body = response.body.string()
|
||||
try {
|
||||
if (response.isSuccessful) {
|
||||
onInfo(Nip11RelayInformation.fromJson(body))
|
||||
if (body.startsWith("{")) {
|
||||
onInfo(Nip11RelayInformation.fromJson(body))
|
||||
} else {
|
||||
onError(relay, ErrorCode.FAIL_TO_PARSE_RESULT, body)
|
||||
}
|
||||
} else {
|
||||
onError(relay, ErrorCode.FAIL_WITH_HTTP_STATUS, response.code.toString())
|
||||
}
|
||||
|
Reference in New Issue
Block a user