Tanza3D / reddark

reddark, but it's in realtime
GNU Affero General Public License v3.0
299 stars 42 forks source link

adding handling for rejected httpsGet promises #19

Closed username-is-required closed 1 year ago

username-is-required commented 1 year ago

this pr adds handling in updateStatus() for when a Promise returned by request.httpsGet is rejected. as mentioned in #17, currently it seems like there isn’t any handling for this scenario.

as a rejected promise would imply something going wrong with the https request, i basically just took a copy of the console.log and setTimeout statements added in 6c29c87, and chucked them in a .catch.

depending on what the underlying problem behind #17 is, this may or may not fix the issue there.

(i also changed a reference to resp to data in one of the console.log calls, as at that point in the code the variable resp doesn’t exist.)

also: disclaimer, although i think it does, i have no idea if this code actually works or not as i can’t test it myself. feel free to modify/ignore if it doesn’t.

Tanza3D commented 1 year ago

unsure how to test the handling, but doesn't seem to break anything so probably good!