Hi all
If the web API is inaccessible and BW attempts to make a request, the app crashes with a BubbleWrap::JSON::ParserError. Adding a begin rescue doesn't seem to prevent the app from crashing. E.g:
begin
BW::HTTP.post(url, payload: payload) do |response|
if response && response.body
data = BW::JSON.parse(response.body.to_str)
# use data
end
end
rescue BubbleWrap::JSON::ParserError => exception
return nil
end
Is there some way to catch & raise an error from BW here? Or is BW able to check if the URL will respond in the first instance (preventing the subsequent ParserError)?
Thanks in advance
Neil