private static void ThrowOnError(int errorCode) { if (Succeeded(errorCode)) { return; } throw new WebSocketException(errorCode); }