Handling .NET Exceptions

Handling .NET Exceptions

Any .NET exception can be handled in your Java code. All javOnet methods that operate on .NET objects throw a JavonetException when exceptions occur. You can catch .NET exceptions by catching the JavonetExceptions, and then perform the appropriate exception handling logic.

	try 
	{
		NObject sampleObj = Javonet.New("Sample");
		Integer result = sampleObj.invoke("AddInt",4,5);

		System.out.println(result);
	}
	catch (JavonetException je)
	{
		//Todo: Your exception handling code
	}

See Live Example!