# MethodInvocationException Constructor

## Overloads

| [MethodInvocationException(String, MethodInvocationException.Error)](https://help.qlik.com/en-US/sense-developer/May2026/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.MethodInvocationException.-ctor.htm#Qlik_Sense_JsonRpc_MethodInvocationException__ctor_System_String_Qlik_Sense_JsonRpc_MethodInvocationException_Error_) |  | Initializes a new instance of the MethodInvocationException class with a specified error message and a reference to the Qlik Sense error that is the cause of this exception. |
| --- | --- | --- |

[](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.MethodInvocationException.-ctor.htm) [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.MethodInvocationException.-ctor.htm)

## MethodInvocationException(String, MethodInvocationException.Error)

Initializes a new instance of the MethodInvocationException class with a specified error message and a reference to the Qlik Sense error that is the cause of this exception.

### Declaration

```

          public MethodInvocationException(string message, MethodInvocationException.Error error)
    
  
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.String | message | The error message that explains the reason for the exception. |
| [MethodInvocationException.Error](https://help.qlik.com/en-US/sense-developer/May2026/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.MethodInvocationException.Error.htm) | error | The Qlik Sense error that is the cause of this exception. |