I have a button that I want to have make a network request and then redirect me to a url. That network effect is a PUT that gets an empty response back, and it seems like SB doesn't handle this, and further, the error isn't "catchable" via pcall.
I have this code:
pcall(function()
net.proxyFetch(url, {
method = "PUT",
headers = {
["X-Auth-Token"] = token
},
body = {
entry_ids = ids,
status = "read"
}
})
end)
In the network tab I can verify the body in the request looks right and that the response is empty. But the console then shows this error:
[Client] Error during : Error: attempt to index a nil value
Alongside a long stack trace including files like eval.ts and runtime.ts. It then has this line:
[Client] Now navigating to Library/Infrastructure/Miniflux@3511
which is the function that calls the one where the pcall and netFetch code I wrote above is. It's right before I then redirect the page, which does not run and instead I get brought to the Miniflux file as the console suggests.