class MalformedResponseException extends UnsupportedFeatureException (View source)

Thrown when the API sent a shape the SDK cannot represent.

Raised by {\CNIC\CNR\Response::stringCells()} when a PROPERTY entry is not a list, or one of its cells is not a string. This is deliberately NOT the "capability absent on this platform or response" meaning {\CNIC\Exception\UnsupportedFeatureException} documents on its own class — nothing is missing here, the wire sent something the SDK's data model has no way to hold.

It extends {\CNIC\Exception\UnsupportedFeatureException} rather than {\CNIC\Exception\CnicException} deliberately: both stringCells() throw sites already raised UnsupportedFeatureException before this type existed, so re-parenting them would break an existing catch (UnsupportedFeatureException) at either site. Extending instead of replacing keeps the split purely additive. Closes the open item recorded under RSRMID-2924 in docs/agents/architecture.md.

Methods

transportOwnedCurlOptions(array $rejected, string $owningClass)

Build the exception raised when {\CNIC\HttpTransport::post()} refuses one or more transport-owned cURL options ({\CNIC\HttpTransport::PROTECTED_OPTIONS}).

sdkManagedCurlOptions(array $rejected, string $owningClass)

Build the exception raised when {\CNIC\AbstractSocketConfig::setExtraCurlOptions()} refuses one or more SDK-managed cURL options ({\CNIC\AbstractSocketConfig::MANAGED_OPTIONS}).

transportOwnedHeader(string $headerName, string $owningClass)

Build the exception raised when {\CNIC\HttpTransport::appendHeaders()} refuses a caller header line that restates one the transport owns.

array
getRejectedCurlOptions()

The cURL options this exception rejected, keyed by the cURL constant and valued with its constant name. Empty for a plainly-constructed instance.

array
getReplacementSetters()

The replacement setter for each rejected cURL option that has one, keyed by the cURL constant and valued with "Fqcn::setter()". Empty when the rejected options have no replacement, or for a plainly-constructed instance.

string|null
getOwningClass()

The class that owns the rejected option(s)/header, or null when this instance carries no structured context.

string|null
getRejectedHeaderName()

The rejected header name, already lower-cased, or null when this instance does not describe a header rejection.

Details

static UnsupportedFeatureException transportOwnedCurlOptions(array $rejected, string $owningClass)

Build the exception raised when {\CNIC\HttpTransport::post()} refuses one or more transport-owned cURL options ({\CNIC\HttpTransport::PROTECTED_OPTIONS}).

A protected option has no replacement setter — it must simply be dropped from the caller's bag — so {\CNIC\Exception\getReplacementSetters()} answers empty for an instance built here.

Parameters

array $rejected

a slice of {\CNIC\HttpTransport::PROTECTED_OPTIONS}

string $owningClass

Return Value

UnsupportedFeatureException

static UnsupportedFeatureException sdkManagedCurlOptions(array $rejected, string $owningClass)

Build the exception raised when {\CNIC\AbstractSocketConfig::setExtraCurlOptions()} refuses one or more SDK-managed cURL options ({\CNIC\AbstractSocketConfig::MANAGED_OPTIONS}).

Note the current message does not name $owningClass — the owner of setExtraCurlOptions() itself is not the point here, each managed option already names its own owner in $rejected; $owningClass is accessor-only.

Parameters

array $rejected

a slice of {\CNIC\AbstractSocketConfig::MANAGED_OPTIONS}

string $owningClass

Return Value

UnsupportedFeatureException

static UnsupportedFeatureException transportOwnedHeader(string $headerName, string $owningClass)

Build the exception raised when {\CNIC\HttpTransport::appendHeaders()} refuses a caller header line that restates one the transport owns.

Parameters

string $headerName
string $owningClass

Return Value

UnsupportedFeatureException

array getRejectedCurlOptions()

The cURL options this exception rejected, keyed by the cURL constant and valued with its constant name. Empty for a plainly-constructed instance.

The actionable use: array_diff_key($yourOptions, $e->getRejectedCurlOptions()) strips exactly the refused keys from the bag you tried to send, so the call can be retried with what is left.

Return Value

array

array getReplacementSetters()

The replacement setter for each rejected cURL option that has one, keyed by the cURL constant and valued with "Fqcn::setter()". Empty when the rejected options have no replacement, or for a plainly-constructed instance.

Return Value

array

string|null getOwningClass()

The class that owns the rejected option(s)/header, or null when this instance carries no structured context.

Return Value

string|null

string|null getRejectedHeaderName()

The rejected header name, already lower-cased, or null when this instance does not describe a header rejection.

Return Value

string|null