---
title: ProtocolException
framework: SiriKit Cloud Media
role: symbol
role_heading: Object
platforms: [sirikit cloud media 1.0.2+]
path: sirikitcloudmedia/protocolexception
---

# ProtocolException

An exception response from a media service.

## Declaration

```data
object ProtocolException
```

## Properties

methodName: The name of the method the service is processing when it encounters the exception. methodIndex: The index within the request’s array of Invocation objects that the service is processing when it encounters the exception. code: The identifier for this exception. reason: The type of exception the service encounters. retryWithDelay: The timespan, in seconds, the client needs to wait before retrying the request. trace: Debugging backtraces or other information. Production services must not provide this information. Clients without an enabled debug setting discard this data.

## Discussion

Discussion You can define a mapping of exception code values that’s meaningful for your service. The client logs these exception codes. The client doesn’t retry if the retryWithDelay value is negative or absent. If the value is greater than 5 seconds, the client may not retry so it can preserve the real-time interaction with the user. Include the methodName and methodIndex whenever the reason is unsupported, unauthorized, invalid, or busy. For other reason values, these properties may help diagnose issues, but aren’t a requirement.

## See Also

### Exceptions

- [ProtocolExceptionInvocationResponse](sirikitcloudmedia/protocolexceptioninvocationresponse.md)
- [ProtocolExceptionReason](sirikitcloudmedia/protocolexceptionreason.md)
