<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SensorKit",
  "identifier" : "/documentation/SensorKit/SRError/Code",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "SensorKit"
    ],
    "preciseIdentifier" : "c:@E@SRErrorCode"
  },
  "title" : "SRError.Code"
}
-->

# SRError.Code

The kinds of problems that stop a recording or a fetch.

```
enum Code
```

## Topics

### Errors

[`SRError.Code.promptDeclined`](/documentation/SensorKit/SRError/Code/promptDeclined)

Occurs when the user cancels the sensor approval workflow.

[`SRError.Code.dataInaccessible`](/documentation/SensorKit/SRError/Code/dataInaccessible)

Occurs when the app can’t access the sensor’s data.

[`SRError.Code.fetchRequestInvalid`](/documentation/SensorKit/SRError/Code/fetchRequestInvalid)

Occurs when the app misconfigures a fetch request.

[`SRError.Code.invalidEntitlement`](/documentation/SensorKit/SRError/Code/invalidEntitlement)

Occurs when the app lacks the required entitlement.

[`SRError.Code.noAuthorization`](/documentation/SensorKit/SRError/Code/noAuthorization)

Occurs when the user declines sensor access in the Settings app.

### Creating an error

[`init(rawValue:)`](/documentation/SensorKit/SRError/Code/init(rawValue:))



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)