Class AudioCppException
The exception thrown when an audio.cpp server reports an error, either through a
non-2xx JSON error envelope ({"error":{"message":…,"type":…}}) or through an
SSE error event.
public class AudioCppException : Exception, ISerializable
- Inheritance
-
AudioCppException
- Implements
- Inherited Members
Constructors
AudioCppException(string)
Creates an exception with a message only (no wire error type or status).
public AudioCppException(string message)
Parameters
messagestringThe message.
AudioCppException(string, string?, int?)
Creates an exception carrying the wire-reported message, error type and HTTP status.
public AudioCppException(string message, string? errorType, int? statusCode)
Parameters
messagestringThe server-reported message, or the raw body text when the body was not an error envelope.
errorTypestringThe envelope's
typefield, or null for SSE error events and non-envelope bodies.statusCodeint?The HTTP status code, or null for SSE error events.
Properties
ErrorType
The server-reported error type, for example server_error,
invalid_request_error, server_busy or insufficient_memory.
null when the body was not an error envelope or the error
arrived as an SSE event (SSE error events carry no type).
public string? ErrorType { get; }
Property Value
StatusCode
The HTTP status code, when the error came from an HTTP response body; null for SSE error events.
public int? StatusCode { get; }
Property Value
- int?