---
title: BimWorksException
summary: Class in BIM.works_SDK.
order: 10
languages: [csharp]
sdk-package: .NET · BIM.works_SDK
---

# BimWorksException

[[page:reference/dotnet/api|API catalogue]] · `BIM.works_SDK` · Class

````csharp sdk=dotnet sdk-namespace="BIM.works_SDK"
public class BimWorksException : Exception, ISerializable
````

Only one type of exception is used in the SDK. Further examination of the actual error can be done by reading the enum (GetEnum)
Each exception will have a unique code and also a human-readable value (message)

## Inheritance and interfaces

- `System.Object`
- `System.Exception`
- `System.Runtime.Serialization.ISerializable`

## Members

| Member | Kind | Description |
|---|---|---|
| [[page:reference/dotnet/bim-works-sdk/bimworksexception-a2ba1743#member-ctor-3025089d80ce|BimWorksException(Enum)]] | Constructor |  |
| [[page:reference/dotnet/bim-works-sdk/bimworksexception-a2ba1743#member-ctor-c8e06419f90b|BimWorksException(string, Enum)]] | Constructor |  |
| [[page:reference/dotnet/bim-works-sdk/bimworksexception-a2ba1743#member-ctor-40fd5ef26a03|BimWorksException(string, int)]] | Constructor |  |
| [[page:reference/dotnet/bim-works-sdk/bimworksexception-a2ba1743#member-getcode-191a8fc122bd|GetCode()]] | Method |  |
| [[page:reference/dotnet/bim-works-sdk/bimworksexception-a2ba1743#member-getdomain-2952c589e14d|GetDomain()]] | Method | The error domain the server sent (for example "BimWorksErrorCode"), or null for errors raised by the SDK itself |
| [[page:reference/dotnet/bim-works-sdk/bimworksexception-a2ba1743#member-getenum-3db7c772ac3b|GetEnum()]] | Method |  |
| [[page:reference/dotnet/bim-works-sdk/bimworksexception-a2ba1743#member-geterrortype-a5288d095bee|GetErrorType()]] | Method | The error name the server sent (for example "NODE_NOT_FOUND"). Also set when this SDK version has no enum value for it, in which case GetEnum() is null |
| [[page:reference/dotnet/bim-works-sdk/bimworksexception-a2ba1743#member-getpayload-be33782d2e60|GetPayload()]] | Method | The data the server sent with the error, null when it sent none. A RESULT_TOO_LARGE refusal of RunIdsCheck carries the IDS summary here; read it with BIM.wor… |
| [[page:reference/dotnet/bim-works-sdk/bimworksexception-a2ba1743#member-getreference-4bb0c83711f7|GetReference()]] | Method | The server's name for the failed request: quote it when you report the error, support finds the request with it. Null when the server did not send one (older… |
| [[page:reference/dotnet/bim-works-sdk/bimworksexception-a2ba1743#member-getusersafemessage-45117b999f4f|GetUserSafeMessage()]] | Method | The server's message for the user (for example why an IDS is invalid), without the error name. Null when the server sent none |
| [[page:reference/dotnet/bim-works-sdk/bimworksexception-a2ba1743#member-tostring-90c1a13b4150|ToString()]] | Method |  |

## `BimWorksException(Enum)` {#member-ctor-3025089d80ce}

````csharp sdk=dotnet sdk-namespace="BIM.works_SDK"
public BimWorksException(Enum enumValue)
````



### Parameters

| Name | Type | Description |
|---|---|---|
| `enumValue` | `System.Enum` |  |

## `BimWorksException(string, Enum)` {#member-ctor-c8e06419f90b}

````csharp sdk=dotnet sdk-namespace="BIM.works_SDK"
public BimWorksException(string message, Enum enumValue)
````



### Parameters

| Name | Type | Description |
|---|---|---|
| `message` | `System.String` |  |
| `enumValue` | `System.Enum` |  |

## `BimWorksException(string, int)` {#member-ctor-40fd5ef26a03}

````csharp sdk=dotnet sdk-namespace="BIM.works_SDK"
public BimWorksException(string message, int code)
````



### Parameters

| Name | Type | Description |
|---|---|---|
| `message` | `System.String` |  |
| `code` | `System.Int32` |  |

## `GetCode()` {#member-getcode-191a8fc122bd}

````csharp sdk=dotnet sdk-namespace="BIM.works_SDK"
public int GetCode()
````



## `GetDomain()` {#member-getdomain-2952c589e14d}

````csharp sdk=dotnet sdk-namespace="BIM.works_SDK"
public string GetDomain()
````

The error domain the server sent (for example "BimWorksErrorCode"), or null for errors raised by the SDK itself

## `GetEnum()` {#member-getenum-3db7c772ac3b}

````csharp sdk=dotnet sdk-namespace="BIM.works_SDK"
public Enum GetEnum()
````



## `GetErrorType()` {#member-geterrortype-a5288d095bee}

````csharp sdk=dotnet sdk-namespace="BIM.works_SDK"
public string GetErrorType()
````

The error name the server sent (for example "NODE_NOT_FOUND"). Also set when this SDK version has no enum value for it, in which case GetEnum() is null

## `GetPayload()` {#member-getpayload-be33782d2e60}

````csharp sdk=dotnet sdk-namespace="BIM.works_SDK"
public JsonElement? GetPayload()
````

The data the server sent with the error, null when it sent none. A RESULT_TOO_LARGE refusal of RunIdsCheck carries
the IDS summary here; read it with [[page:reference/dotnet/bim-works-sdk/checks-2170f5f1#member-readtoolargesummary-3fba097aa167|BIM.works_SDK.Checks.ReadTooLargeSummary(BIM.works_SDK.BimWorksException)]]

## `GetReference()` {#member-getreference-4bb0c83711f7}

````csharp sdk=dotnet sdk-namespace="BIM.works_SDK"
public string GetReference()
````

The server's name for the failed request: quote it when you report the error, support finds the request with it.
Null when the server did not send one (older servers, and errors of the connection itself)

## `GetUserSafeMessage()` {#member-getusersafemessage-45117b999f4f}

````csharp sdk=dotnet sdk-namespace="BIM.works_SDK"
public string GetUserSafeMessage()
````

The server's message for the user (for example why an IDS is invalid), without the error name. Null when the server sent none

## `ToString()` {#member-tostring-90c1a13b4150}

````csharp sdk=dotnet sdk-namespace="BIM.works_SDK"
public override string ToString()
````



## Inherited members

- `System.Exception.GetBaseException`
- `System.Exception.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)`
- `System.Exception.GetType`
- `System.Exception.Data`
- `System.Exception.HelpLink`
- `System.Exception.HResult`
- `System.Exception.InnerException`
- `System.Exception.Message`
- `System.Exception.Source`
- `System.Exception.StackTrace`
- `System.Exception.TargetSite`
- `System.Exception.SerializeObjectState`
- `System.Object.Equals(System.Object)`
- `System.Object.Equals(System.Object,System.Object)`
- `System.Object.GetHashCode`
- `System.Object.MemberwiseClone`
- `System.Object.ReferenceEquals(System.Object,System.Object)`
