---
title: Background task cancellation
framework: foundation
role: collectionGroup
role_heading: API Collection
path: foundation/background-task-cancellation
---

# Background task cancellation

Constants that indicate why a background task was canceled.

## Overview

Overview These values are used in conjunction with the NSURLErrorBackgroundTaskCancelledReasonKey key in an NSError object’s userInfo dictionary.

## Topics

### Cancellation reasons

- [NSURLErrorCancelledReasonBackgroundUpdatesDisabled](foundation/nsurlerrorcancelledreasonbackgroundupdatesdisabled.md)
- [NSURLErrorCancelledReasonInsufficientSystemResources](foundation/nsurlerrorcancelledreasoninsufficientsystemresources.md)
- [NSURLErrorCancelledReasonUserForceQuitApplication](foundation/nsurlerrorcancelledreasonuserforcequitapplication.md)

## See Also

### Handling errors

- [URL session error dictionary keys](foundation/url-session-error-dictionary-keys.md)
