<!--
{
  "availability" : [
    "iOS: 17.4.0 -",
    "iPadOS: 17.4.0 -",
    "macCatalyst: 17.4.0 -",
    "macOS: 14.4.0 -",
    "tvOS: 17.4.0 -",
    "visionOS: 1.1.0 -",
    "watchOS: 10.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "LightweightCodeRequirements",
  "identifier" : "/documentation/LightweightCodeRequirements/ConstraintError",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "LightweightCodeRequirements"
    ],
    "preciseIdentifier" : "s:27LightweightCodeRequirements15ConstraintErrorO"
  },
  "title" : "ConstraintError"
}
-->

# ConstraintError

Error types that can be thrown from lightweight code requirement routines.

```
enum ConstraintError
```

## Topics

### Enumeration Cases

[`case duplicateKey`](/documentation/LightweightCodeRequirements/ConstraintError/duplicateKey)

Two constraints of the same type were found in the same logical group.

[`case malformedConstraint`](/documentation/LightweightCodeRequirements/ConstraintError/malformedConstraint)

An unexpected type was found when trying to encode or decode a constraint.

[`case taskIsNoLongerValid`](/documentation/LightweightCodeRequirements/ConstraintError/taskIsNoLongerValid)

A SecTask operation failed because the task is no longer valid

[`case unsupportedConstraintForRequirementType`](/documentation/LightweightCodeRequirements/ConstraintError/unsupportedConstraintForRequirementType)

Converting one code requirement type to another failed because the original requirement included a constraint that is not supported by the target requirement type.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`Hashable`](/documentation/Swift/Hashable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Equatable`](/documentation/Swift/Equatable)

[`Error`](/documentation/Swift/Error)

---

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)