---
title: "Class HttpResponseMessageExtensions"
slug: "web-sdk--stylelabs.m.sdk.webclient.http.httpresponsemessageextensions"
abstract: ""
---
# Class HttpResponseMessageExtensions

Extension methods for the class mainly to handle common errors which can happen when using Sitecore Content Hub REST API.

## Inheritance

object

HttpResponseMessageExtensions

## Namespace: StylelabsStylelabs.MSdkWebClientHttp

## Assembly: Stylelabs.M.Sdk.WebClient.dll

## Syntax

```csharp
public static class HttpResponseMessageExtensions
```

## Methods

### HandleErrors(HttpResponseMessage)

Inspects the specified `response` and throws an instance of if it contains errors (i.e. the `response` is not success).

#### Declaration

```csharp
public static Task HandleErrors(this HttpResponseMessage response)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| HttpResponseMessage | response | The response to inspect. |

#### Returns

| Type | Description |
| --- | --- |
| Task | An awaitable . |
