mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-08 23:54:39 +00:00
Reduces errors when trying to parse unparseable NIP-11s
This commit is contained in:
+5
-1
@@ -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