How to determine the actual error state the corresponds to the StreamPeerTCP get_status() error?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By stormreaver

I am monitoring the state of a StreamPeerTCP connection using get_status(). When get_status() returns 3 (“A status representing a StreamPeerTCP in error state.”), how do I determine what the underlying error is that put the connection into the error status?

:bust_in_silhouette: Reply From: stormreaver

I’m answering my own question. Upon reading the Godot source code, I conclude that there is no API for retrieving the underlying error condition. Godot does not provide an interface to retrieve the underlying errno state, nor does it provide an interface for retrieving the human-readable equivalent.

In other words, there is no way to know what caused the error, except for educated guesses.