Skip to content

[QUIC] Implement better QUIC status code messages #32066

@scalablecory

Description

@scalablecory

Error messages created for status codes should have a more descriptive, and localizable, error.

public static string GetError(uint status)
{
return status switch
{
Success => "SUCCESS",
Pending => "PENDING",
Continue => "CONTINUE",
OutOfMemory => "OUT_OF_MEMORY",
InvalidParameter => "INVALID_PARAMETER",
InvalidState => "INVALID_STATE",
NotSupported => "NOT_SUPPORTED",
NotFound => "NOT_FOUND",
BufferTooSmall => "BUFFER_TOO_SMALL",
HandshakeFailure => "HANDSHAKE_FAILURE",
Aborted => "ABORTED",
AddressInUse => "ADDRESS_IN_USE",
ConnectionTimeout => "CONNECTION_TIMEOUT",
ConnectionIdle => "CONNECTION_IDLE",
InternalError => "INTERNAL_ERROR",
ServerBusy => "SERVER_BUSY",
ProtocolError => "PROTOCOL_ERROR",
VerNegError => "VER_NEG_ERROR",
_ => status.ToString()

Metadata

Metadata

Assignees

Labels

area-System.Net.QuicenhancementProduct code improvement that does NOT require public API changes/additions

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions