# ServerSheetControlException Class

> ServerSheetControlException class in the TX Sheet Control .NET API: Worksheet-scoped server API contract. Covers 1 constructor and 1 property and a C# example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Namespace:** `TXTextControl.TXSheetControl.Server`
- **Package:** `TXTextControl.TXSheetControl.Server` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Package:** `TXTextControl.TXSheetControl.Blazor` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Inherits:** `System.Exception`
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > ServerSheetControlException Class
- **638 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/serversheetcontrolexception/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/serversheetcontrolexception/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/serversheetcontrolexception/llms-full.txt

---

Worksheet-scoped server API contract; requests retain document identity and cancellation semantics.

### Syntax

```csharp
public class ServerSheetControlException
```

Interfaces: `ISerializable`.

### Members

#### Constructors

| Constructor | Description |
|---|---|
| [Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/serversheetcontrolexception/constructor/llms-full.txt) |  |

#### Properties

| Property | Description |
|---|---|
| [Code](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/serversheetcontrolexception/code-property/llms-full.txt) |  |

### Examples

Convert an application-supplied workbook and return a structured failure to the caller. Missing or invalid licenses fail; configure a valid signed token before retrying.

```csharp
using TXTextControl.TXSheetControl.Server;

async Task<(byte[]? Pdf, string? Error)> TryConvertInvoiceAsync(byte[] workbookBytes, string signedLicense)
{
    try
    {
        await using var control = new ServerSheetControl(new ServerSheetControlOptions { License = signedLicense });
        await control.LoadAsync(workbookBytes, StreamType.SpreadsheetML);
        return (await control.SaveAsync(StreamType.PDF), null);
    }
    catch (ServerSheetControlException error)
    {
        return (null, error.Code + ": " + error.Message);
    }
}
```

### See Also

- [TXTextControl.TXSheetControl.Server Namespace](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/llms-full.txt)
- [Workbooks and Worksheets](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/workbooks/llms-full.txt)

---

## In This Section

- [ServerSheetControlException.Code Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/serversheetcontrolexception/code-property/llms-full.txt): ServerSheetControlException.Code property in the TX Sheet Control .NET API, with its syntax, its type string and a C# example.
- [ServerSheetControlException Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/serversheetcontrolexception/constructor/llms-full.txt): ServerSheetControlException constructor in the TX Sheet Control .NET API, with the parameters code and message and a C# example.

---

## Nearby

- **Previous:** [ServerSheetControl.Workbook Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/serversheetcontrol/workbook-property/llms-full.txt)
- **Next:** [ServerSheetControlException Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/serversheetcontrolexception/constructor/llms-full.txt)
