Added 'connection refused' stream error.

This commit is contained in:
2024-12-13 10:01:33 +01:00
parent 713d5ca02d
commit 41618310e4
2 changed files with 170 additions and 7 deletions

View File

@@ -66,13 +66,14 @@ enum class FileOpenMode
enum class [[nodiscard]] StreamError
{
SUCCESS = 0,
IO_ERROR = 1,
NOT_SUPPORTED = 2,
CONNECTION_CLOSED = 3,
PROTOCOL_ERROR = 4,
WOULD_BLOCK = 5,
UNKNOWN_ERROR = -1
SUCCESS = 0,
IO_ERROR = 1,
NOT_SUPPORTED = 2,
CONNECTION_CLOSED = 3,
PROTOCOL_ERROR = 4,
WOULD_BLOCK = 5,
CONNECTION_REFUSED = 6,
UNKNOWN_ERROR = -1
};
class Stream
@@ -450,6 +451,8 @@ inline const char* errorName(StreamError error) MIJIN_NOEXCEPT
return "would block";
case StreamError::UNKNOWN_ERROR:
return "unknown error";
case StreamError::CONNECTION_REFUSED:
return "connection refused";
}
return "<invalid error>";
}