---
title: error
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/urlauthenticationchallenge/error
---

# error

The error object representing the last authentication failure.

## Declaration

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

## Discussion

Discussion This value is nil if the protocol doesn’t use errors to indicate an authentication failure.

## See Also

### Related Documentation

- [failureResponse](foundation/urlauthenticationchallenge/failureresponse.md)
