ID:1969145
 
Applies to:
Status: Open

Issue hasn't been assigned a status value.
I dunno why I didn't test this sooner, but it would make so much sense to be able to catch bad world.Export calls like this:

mob/verb/http_404_bug()
try
var/list/thing[] = world.Export("http://www.dccomics.com/node/237231876")
if(!thing) world << "it done borked"
catch(var/exception/e)
world << "this happened"

mob/verb/https_bug()
try
var/list/thing[] = world.Export("https://google.com")
if(!thing) world << "it done borked"
catch(var/exception/e)
world << "this happened"


In the first case - the page returns a 404. thing is null, however. I suggested a solution to this years ago, id:117064. The error is an orange message only visible in Options & Messages and Dream Daemon:
"BUG: Http error: HTTP server returned unexpected status: 404 Not Found".

Similar error outputs happen for other response codes as well.

In the second case, it gives a red, runtime-like error, simply:
Invalid network address in transmission (https://google.com)
but, it's not treated as a runtime. It simply hangs the proc forever (per .debug status)

It'd make sense if both were able to be caught by try/catch (or, world.Error). I'd understand if this was only for the latter case, as changing the first case might break older projects.
I could have sworn there was a request for this already. But no matter. In principle I agree with you here, so I can look into this and see what's feasible.
Ah, there totally is. no idea how I didn't catch that, considering I posted in it.

ID:1875717