wrapError()
SIP Protocol API Reference v0.7.0
SIP Protocol API Reference / wrapError
Function: wrapError()
Section titled “Function: wrapError()”wrapError(
error,message,code?,context?):SIPError
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:290
Wrap an unknown error as a SIPError
Useful for catching and re-throwing with additional context.
Parameters
Section titled “Parameters”unknown
message
Section titled “message”string
context?
Section titled “context?”Record<string, unknown>
Returns
Section titled “Returns”Example
Section titled “Example”try { await riskyOperation()} catch (e) { throw wrapError(e, 'Operation failed', ErrorCode.INTERNAL)}