---
title: error
framework: photos
role: symbol
role_heading: Instance Property
path: photos/phassetresourceuploadjob/error
---

# error

The error that caused the job to fail.

## Declaration

```swift
var error: (any Error)? { get }
```

## Mentioned in

Uploading asset resources in the background

## Return Value

Return Value An error object describing the failure, or nil if the job has not failed.

## Discussion

Discussion This property is populated when the job reaches the PHAssetResourceUploadJobStateFailed state. It provides detailed information about why the upload failed, including network errors, server errors, or client-side errors. note: The error provided is sanitized and may not be the actual error returned from URLResponse.

## See Also

### Inspecting a job

- [type](photos/phassetresourceuploadjob/type-swift.property.md)
- [PHAssetResourceUploadJob.Type](photos/phassetresourceuploadjob/type-swift.enum.md)
- [destination](photos/phassetresourceuploadjob/destination.md)
- [resource](photos/phassetresourceuploadjob/resource.md)
- [state](photos/phassetresourceuploadjob/state-swift.property.md)
- [PHAssetResourceUploadJob.State](photos/phassetresourceuploadjob/state-swift.enum.md)
- [responseHeaderFields](photos/phassetresourceuploadjob/responseheaderfields.md)
