UnsupportedFeatureException
class UnsupportedFeatureException extends CnicException (View source)
Thrown when a capability is not available on the current platform or response.
Some operations exist on the shared contract but are not offered by every brand — e.g. the IBS/Moniker platform has no API session, user roles, high performance connection setup, queue/runtime metrics, temporary-error or pending states, and no server-side list-hash. Calling such a method raises this exception instead of returning a misleading value.
It also covers the handful of "an option/header the SDK or transport already owns cannot be overridden through a generic bag" rejections — those are the situations a caller can actually act on, and they carry structured context (which key(s) were rejected, what replaces them, which class owns the rejection) alongside the message, via the named constructors below ({\CNIC\Exception\transportOwnedCurlOptions()}, {\CNIC\Exception\sdkManagedCurlOptions()}, {@see \CNIC\Exception\transportOwnedHeader()}) and read back through the accessors. Message and context are composed together, on purpose: a message that describes one thing while the accessors describe another is exactly the drift this structure exists to remove.
Not every throw site has something actionable to hand back. The config-type
guard in {\CNIC\CNR\Client::getSocketConfig()} deliberately keeps using
the plain constructor: it protects against a subclass supplying the wrong
SocketConfig type, which is unreachable in practice and, if it were ever
reached, is a programming error with nothing a caller could act on — there is
no replacement setter or rejected key to report.
Methods
Build the exception raised when {\CNIC\HttpTransport::post()} refuses one or more transport-owned cURL options ({\CNIC\HttpTransport::PROTECTED_OPTIONS}).
Build the exception raised when {\CNIC\AbstractSocketConfig::setExtraCurlOptions()} refuses one or more SDK-managed cURL options ({\CNIC\AbstractSocketConfig::MANAGED_OPTIONS}).
Build the exception raised when {\CNIC\HttpTransport::appendHeaders()} refuses a caller header line that restates one the transport owns.
The cURL options this exception rejected, keyed by the cURL constant and valued with its constant name. Empty for a plainly-constructed instance.
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.
The class that owns the rejected option(s)/header, or null when this instance carries no structured context.
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.
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.
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.
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.
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.