Skip to content

Commit

Permalink
Add log when onError is called
Browse files Browse the repository at this point in the history
  • Loading branch information
greenart7c3 committed Jan 17, 2025
1 parent 8e2849b commit d1eab8a
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,23 @@ object NotificationDataSource : NostrDataSource(NostrSigner.getInstance().client
}
}

override fun onError(error: Error, subscriptionId: String, relay: Relay) {
scope.launch {
LocalPreferences.currentAccount(NostrSigner.getInstance())?.let { account ->
NostrSigner.getInstance().getDatabase(account).applicationDao().insertLog(
LogEntity(
id = 0,
url = relay.url,
type = "onError",
message = error.message ?: "Unknown error",
time = System.currentTimeMillis(),
),
)
}
}
super.onError(error, subscriptionId, relay)
}

override fun onAuth(
relay: Relay,
challenge: String,
Expand Down

0 comments on commit d1eab8a

Please sign in to comment.