# ThrowNew(nint, string)

> Constructs an exception object from the specified class with the \<tt\>message\</tt\> specified by message and causes that exception to be thrown.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/7000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.AndroidJNIModule

## ThrowNew(IntPtr, string)

```csharp
public static int ThrowNew(nint clazz, string message)
```

### Parameters

**** (\[IntPtr]\(https\://learn.microsoft.com/dotnet/api/system.intptr)): The class of the exception to construct and throw.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The exception message.

### Returns

| Type                                                       | Description                                   |
| ---------------------------------------------------------- | --------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Zero on success. A negative value on failure. |

### Remarks

Additional Resources: [Java Native Interface Specification (Oracle)](http://download.oracle.com/javase/1.5.0/docs/guide/jni/spec/jniTOC.html)
