---
id: "P:cAlgo.API.HttpResponse.Exception"
kind: "property"
type: "T:cAlgo.API.HttpResponse"
url: "https://help.ctrader.com/ctrader-algo/references/HTTP/HttpResponse/Exception/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# HttpResponse.Exception

Member of [HttpResponse](https://help.ctrader.com/ctrader-algo/references/HTTP/HttpResponse/index.md).

## Exception

Gets the exception thrown when sending HTTP request.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public HttpException Exception {get;}
```

Python:

```python
httpResponse.Exception: HttpException
```

### Returns

`HttpException` — 

### Examples

C#:

```csharp
var response = Http.Get("https://api.example.com/quotes/EURUSD");
if (response.Exception != null)
    Print("Request error: {0}", response.Exception.Message);
```

Python:

```python
response = api.Http.Get("https://api.example.com/quotes/EURUSD")
if response.Exception is not None:
    api.Print(f"Request error: {response.Exception.Message}")
```

