Skip to main content

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

Function: GetErrorCode

▸ GetErrorCode(error): ConnectionErrorCode | undefined

Extracts the ConnectionErrorCode from an unknown value. Returns undefined for any value that is not a ConnectionError.

Parameters​

NameTypeDescription
errorunknownThe caught error value.

Returns​

ConnectionErrorCode | undefined

The ConnectionErrorCode if the error is a ConnectionError, otherwise undefined.