Skip to main content

@enreachde/swyx-web-extension-sdk - v1.0.1 / Exports / GetConnectionError

Function: GetConnectionError

▸ GetConnectionError(error): ConnectionError

Converts an unknown thrown value into a ConnectionError. If the value is already a ConnectionError it is returned as-is; otherwise a new error with code ConnectionErrorCode.ConnectFailed is created.

Parameters​

NameTypeDescription
errorunknownThe caught error value.

Returns​

ConnectionError

A ConnectionError that represents the failure.