Skip to content

Commit

Permalink
assert response status
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangruber committed Oct 24, 2023
1 parent eac09d8 commit 88e6ee8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions main/wallet-backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ class WalletBackend {
async getMessages (address) {
const url = `https://filfox.info/api/v1/address/${address}/messages?pageSize=1000000`
const res = await fetch(url)
assert(res.ok, `Could not fetch messages (Status ${res.status})`)
/** @type {{messages: FoxMessage[] | null}} */
const { messages } = /** @type {any} */ (await res.json())
return messages || []
Expand Down

0 comments on commit 88e6ee8

Please sign in to comment.