dxFeed Graal CXX API v9.0.0
Loading...
Searching...
No Matches
JavaException Struct Reference

A wrapper over the interceptable Java exceptions thrown by the dxFeed Native Graal SDK. More...

#include <JavaException.hpp>

Inheritance diagram for JavaException:

Public Member Functions

 JavaException (StringParam message, StringParam className, StringParam stackTrace)
 Creates an exception using Java message, className and stack trace.
const std::string & getJavaClassName () const &noexcept
const std::string & getJavaMessage () const &noexcept
const std::string & getJavaStackTrace () const &noexcept
Public Member Functions inherited from RuntimeException
 RuntimeException (StringParam message, StringParam additionalStackTrace="")
 Constructs a runtime exception.
const std::string & getStackTrace () const &
 Returns the stacktrace.

Static Public Member Functions

static JavaException create (void *exceptionHandle)
 Creates an exception using native (GraalVM) Java exception handle.
static JavaException createAndRelease (void *exceptionHandle)
 Creates an exception from a native Java exception handle and releases the native representation.
static void throwIfJavaThreadExceptionExists ()
 Throws a JavaException if it exists (i.e. intercepted by Graal SDK).

Detailed Description

A wrapper over the interceptable Java exceptions thrown by the dxFeed Native Graal SDK.

Constructor & Destructor Documentation

◆ JavaException()

JavaException::JavaException ( StringParam message,
StringParam className,
StringParam stackTrace )

Creates an exception using Java message, className and stack trace.

Also uses current stack trace.

Parameters
messageJava message.
classNameJava class name.
stackTraceJava stack trace.

References JavaException().

Referenced by JavaException().

Member Function Documentation

◆ create()

JavaException JavaException::create ( void * exceptionHandle)
static

Creates an exception using native (GraalVM) Java exception handle.

Parameters
exceptionHandleThe native Java exception handle.
Returns
An exception.

Referenced by createAndRelease().

◆ createAndRelease()

JavaException JavaException::createAndRelease ( void * exceptionHandle)
static

Creates an exception from a native Java exception handle and releases the native representation.

Parameters
exceptionHandleThe native Java exception handle.
Returns
An exception containing a copy of the native exception data.

References create().

◆ getJavaClassName()

const std::string & JavaException::getJavaClassName ( ) const &
noexcept
Returns
The class name of the Java exception.

◆ getJavaMessage()

const std::string & JavaException::getJavaMessage ( ) const &
noexcept
Returns
The message of the Java exception, without the prefix that what() adds.

◆ getJavaStackTrace()

const std::string & JavaException::getJavaStackTrace ( ) const &
noexcept
Returns
The stack trace of the Java exception.