{"record":{"id":"ca4711a136553bce","repo":"oracle/graal","slug":"the-exception-object-must-be-a-non-null-object","errorCode":null,"errorMessage":"The exception object must be a non-null object","messagePattern":"The exception object must be a non-null object","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler.vmaccess/src/jdk/graal/compiler/vmaccess/InvocationException.java","lineNumber":46,"sourceCode":"\n/**\n * Exception thrown when a method invoked through {@link VMAccess#invoke} throws an exception.\n * <p>\n * The thrown exception can be retrieved with {@link #getExceptionObject()} if it is a \"guest\"\n * exception.\n */\n@SuppressWarnings(\"serial\")\npublic class InvocationException extends RuntimeException {\n    private final JavaConstant exceptionObject;\n\n    /**\n     * Constructs an {@link InvocationException} for the given exception object.\n     *\n     * @param exceptionObject a {@link JavaConstant} representing a non-null exception object.\n     */\n    public InvocationException(JavaConstant exceptionObject) {\n        if (exceptionObject.isNull() || !exceptionObject.getJavaKind().isObject()) {\n            throw new IllegalArgumentException(\"The exception object must be a non-null object\");\n        }\n        this.exceptionObject = exceptionObject;\n    }\n\n    /**\n     * Constructs an {@link InvocationException} for the given exception object and cause.\n     *\n     * @param exceptionObject a {@link JavaConstant} representing a non-null exception object.\n     * @param cause an exception that was involved in the exception handling of\n     *            {@code exceptionObject}.\n     */\n    public InvocationException(JavaConstant exceptionObject, Throwable cause) {\n        super(cause);\n        if (exceptionObject.isNull() || !exceptionObject.getJavaKind().isObject()) {\n            throw new IllegalArgumentException(\"The exception object must be a non-null object\");\n        }\n        this.exceptionObject = exceptionObject;\n    }","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler.vmaccess/src/jdk/graal/compiler/vmaccess/InvocationException.java#L28-L64","documentation":"Error \"The exception object must be a non-null object\" thrown in oracle/graal.","triggerScenarios":"Thrown at compiler/src/jdk.graal.compiler.vmaccess/src/jdk/graal/compiler/vmaccess/InvocationException.java:46 when the library encounters an invalid state.","commonSituations":"Occurs when a caller violates the contract guarded by this check: The exception object must be a non-null object","solutions":["Fix the condition reported by the error: The exception object must be a non-null object","Check the throwing call site and ensure its documented preconditions (argument values, types, environment, or configuration) are satisfied before the call."],"exampleFix":"Validate inputs and environment so that the failing condition does not occur: The exception object must be a non-null object","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}