How the fuck did I miss this for so long?
Fixed the error handling of sockets in endpoint.