Table of Contents

Class AudioCppException

Namespace
Mabs.AudioCpp.Http
Assembly
AudioCpp.dll

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

message string

The 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

message string

The server-reported message, or the raw body text when the body was not an error envelope.

errorType string

The envelope's type field, or null for SSE error events and non-envelope bodies.

statusCode int?

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

string

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?