<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "BackgroundTasks",
  "identifier" : "/documentation/BackgroundTasks/BGTaskScheduler/Error",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Background Tasks",
      "BackgroundTasks"
    ],
    "preciseIdentifier" : "s:SC24BGTaskSchedulerErrorCodeLeV"
  },
  "title" : "BGTaskScheduler.Error"
}
-->

# BGTaskScheduler.Error

The Errors for the `BGTaskSchedulerError` domain.

```
struct Error
```

## Topics

### Getting the error codes

[`enum Code`](/documentation/BackgroundTasks/BGTaskScheduler/Error/Code)

An enumeration of the task scheduling errors.

[`static var notPermitted: BGTaskScheduler.Error.Code`](/documentation/BackgroundTasks/BGTaskScheduler/Error/notPermitted)

A task scheduling error that indicates the app isn’t permitted to launch the task.

[`static var tooManyPendingTaskRequests: BGTaskScheduler.Error.Code`](/documentation/BackgroundTasks/BGTaskScheduler/Error/tooManyPendingTaskRequests)

A task scheduling error that indicates there are too many pending tasks of the type requested.

[`static var unavailable: BGTaskScheduler.Error.Code`](/documentation/BackgroundTasks/BGTaskScheduler/Error/unavailable)

A task scheduling error that indicates the app or extension can’t schedule background work.

### Getting the error domain

[`static var errorDomain: String`](/documentation/BackgroundTasks/BGTaskScheduler/Error/errorDomain)

The background tasks error domain as a string.

### Type Properties

[`static var immediateRunIneligible: BGTaskScheduler.Error.Code`](/documentation/BackgroundTasks/BGTaskScheduler/Error/immediateRunIneligible)

## Relationships

### Conforms To

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

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

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

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

[`CustomNSError`](/documentation/Foundation/CustomNSError)

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

---

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)