Help us improve by taking our short survey: https://www.hdfgroup.org/website-survey/

| HDF5 Last Updated on 2026-03-23 The HDF5 Field Guide

Loading...
Searching...
No Matches
Java Error (H5E) Interface

## Detailed Description

See also
  Error Handling (H5E), C-API
  HDF5 Error Handling, User Guide

## Functions
static synchronized native boolean | H5Eauto_is_v2 (long stack_id) throws HDF5LibraryException
static int | H5Eclear () throws HDF5LibraryException
static void | H5Eclear (long stack_id) throws HDF5LibraryException
static synchronized native void | H5Eclear2 (long stack_id) throws HDF5LibraryException
static synchronized native void | H5Eclose_msg (long err_id) throws HDF5LibraryException
static synchronized native void | H5Eclose_stack (long stack_id) throws HDF5LibraryException
static synchronized native long | H5Ecreate_msg (long cls_id, int msg_type, String msg) throws HDF5LibraryException, NullPointerException
static synchronized native long | H5Ecreate_stack () throws HDF5LibraryException
static synchronized native String | H5Eget_class_name (long class_id) throws HDF5LibraryException, NullPointerException
static synchronized native long | H5Eget_current_stack () throws HDF5LibraryException
static synchronized native String | H5Eget_msg (long msg_id, int[] type_list) throws HDF5LibraryException
static synchronized native long | H5Eget_num (long stack_id) throws HDF5LibraryException, NullPointerException
static synchronized native void | H5Epop (long stack_id, long count) throws HDF5LibraryException
static synchronized native void | H5Eprint2 (long stack_id, Object stream) throws HDF5LibraryException
static void | H5Epush (long stack_id, String file, String func, int line, long cls_id, long maj_id, long min_id, String msg) throws HDF5LibraryException, NullPointerException
static synchronized native void | H5Epush2 (long stack_id, String file, String func, int line, long cls_id, long maj_id, long min_id, String msg) throws HDF5LibraryException, NullPointerException
static synchronized native long | H5Eregister_class (String cls_name, String lib_name, String version) throws HDF5LibraryException, NullPointerException
static synchronized native void | H5Eset_current_stack (long stack_id) throws HDF5LibraryException
static synchronized native void | H5Eunregister_class (long class_id) throws HDF5LibraryException
static void | H5Ewalk (long stack_id, long direction, H5E_walk_cb func, H5E_walk_t client_data) throws HDF5LibraryException, NullPointerException
static synchronized native void | H5Ewalk2 (long stack_id, long direction, H5E_walk_cb func, H5E_walk_t client_data) throws HDF5LibraryException, NullPointerException

## Function Documentation

## ◆ H5Eauto_is_v2()

synchronized native boolean H5Eauto_is_v2 | ( | long | stack_id | ) | throws HDF5LibraryException
| static

H5Eauto_is_v2 determines whether the error auto reporting function for an error stack conforms to the H5E_auto2_t typedef or the H5E_auto1_t typedef.

Parameters

  stack_id | IN: Error stack identifier.

Returns
  boolean true if the error stack conforms to H5E_auto2_t and false if it conforms to H5E_auto1_t.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.

## ◆ H5Eclear() [1/2]

int H5Eclear | ( |  | ) | throws HDF5LibraryException
| static

H5Eclear clears the error stack for the current thread. H5Eclear can fail if there are problems initializing the library.

This may be used by exception handlers to assure that the error condition in the HDF5 library has been reset.

Returns
  Returns a non-negative value if successful

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.

## ◆ H5Eclear() [2/2]

void H5Eclear | ( | long | stack_id | ) | throws HDF5LibraryException
| static

H5Eclear clears the error stack specified by estack_id, or, if estack_id is set to H5E_DEFAULT, the error stack for the current thread.

Parameters

  stack_id | IN: Error stack identifier.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.

## ◆ H5Eclear2()

synchronized native void H5Eclear2 | ( | long | stack_id | ) | throws HDF5LibraryException
| static

H5Eclear2 clears the error stack specified by estack_id, or, if estack_id is set to H5E_DEFAULT, the error stack for the current thread.

Parameters

  stack_id | IN: Error stack identifier.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.

## ◆ H5Eclose_msg()

synchronized native void H5Eclose_msg | ( | long | err_id | ) | throws HDF5LibraryException
| static

H5Eclose_msg closes an error message identifier, which can be either a major or minor message.

Parameters

  err_id | IN: Error message identifier.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.

## ◆ H5Eclose_stack()

synchronized native void H5Eclose_stack | ( | long | stack_id | ) | throws HDF5LibraryException
| static

H5Eclose_stack closes the object handle for an error stack and releases its resources.

Parameters

  stack_id | IN: Error stack identifier.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.

## ◆ H5Ecreate_msg()

synchronized native long H5Ecreate_msg | ( | long | cls_id,
|  | int | msg_type,
|  | String | msg ) throws HDF5LibraryException, NullPointerException
| static

H5Ecreate_msg adds an error message to an error class defined by client library or application program.

Parameters

  cls_id | IN: Error class identifier.
  msg_type | IN: The type of the error message.
  msg | IN: The error message.

Returns
  a message identifier

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.
  NullPointerException | msg is null.

## ◆ H5Ecreate_stack()

synchronized native long H5Ecreate_stack | ( |  | ) | throws HDF5LibraryException
| static

H5Ecreate_stack creates a new empty error stack and returns the new stack's identifier.

Returns
  an error stack identifier

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.

## ◆ H5Eget_class_name()

synchronized native String H5Eget_class_name | ( | long | class_id | ) | throws HDF5LibraryException, NullPointerException
| static

H5Eget_class_name retrieves the name of the error class specified by the class identifier.

Parameters

  class_id | IN: Error class identifier.

Returns
  the name of the error class

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.

## ◆ H5Eget_current_stack()

synchronized native long H5Eget_current_stack | ( |  | ) | throws HDF5LibraryException
| static

H5Eget_current_stack copies the current error stack and returns an error stack identifier for the new copy.

Returns
  an error stack identifier

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.

## ◆ H5Eget_msg()

synchronized native String H5Eget_msg | ( | long | msg_id,
|  | int[] | type_list ) throws HDF5LibraryException
| static

H5Eget_msg retrieves the error message including its length and type.

Parameters

  msg_id | IN: Name of the error class.
  type_list | OUT: The type of the error message. Valid values are H5E_MAJOR and H5E_MINOR.

Returns
  the error message

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.

## ◆ H5Eget_num()

synchronized native long H5Eget_num | ( | long | stack_id | ) | throws HDF5LibraryException, NullPointerException
| static

H5Eget_num retrieves the number of error records in the error stack specified by estack_id (including major, minor messages and description).

Parameters

  stack_id | IN: Error stack identifier.

Returns
  the number of error messages

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.

## ◆ H5Epop()

synchronized native void H5Epop | ( | long | stack_id,
|  | long | count ) throws HDF5LibraryException
| static

H5Epop deletes the number of error records specified in count from the top of the error stack specified by estack_id (including major, minor messages and description).

Parameters

  stack_id | IN: Error stack identifier.
  count | IN: Version of the client library or application to which the error class belongs.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.

## ◆ H5Eprint2()

synchronized native void H5Eprint2 | ( | long | stack_id,
|  | Object | stream ) throws HDF5LibraryException
| static

H5Eprint2 prints the error stack specified by estack_id on the specified stream, stream.

Parameters

  stack_id | IN: Error stack identifier.If the identifier is H5E_DEFAULT, the current error stack will be printed.
  stream | IN: File pointer, or stderr if null.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.

## ◆ H5Epush()

void H5Epush | ( | long | stack_id,
|  | String | file,
|  | String | func,
|  | int | line,
|  | long | cls_id,
|  | long | maj_id,
|  | long | min_id,
|  | String | msg ) throws HDF5LibraryException, NullPointerException
| static

H5Epush pushes a new error record onto the error stack specified by estack_id.

Parameters

  stack_id | IN: Error stack identifier.
  file | IN: Name of the file in which the error was detected.
  func | IN: Name of the function in which the error was detected.
  line | IN: Line number within the file at which the error was detected.
  cls_id | IN: Error class identifier.
  maj_id | IN: Major error identifier.
  min_id | IN: Minor error identifier.
  msg | IN: Error description string.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.
  NullPointerException | file, func, or msg is null.

## ◆ H5Epush2()

synchronized native void H5Epush2 | ( | long | stack_id,
|  | String | file,
|  | String | func,
|  | int | line,
|  | long | cls_id,
|  | long | maj_id,
|  | long | min_id,
|  | String | msg ) throws HDF5LibraryException, NullPointerException
| static

H5Epush2 pushes a new error record onto the error stack specified by estack_id.

Parameters

  stack_id | IN: Error stack identifier.
  file | IN: Name of the file in which the error was detected.
  func | IN: Name of the function in which the error was detected.
  line | IN: Line number within the file at which the error was detected.
  cls_id | IN: Error class identifier.
  maj_id | IN: Major error identifier.
  min_id | IN: Minor error identifier.
  msg | IN: Error description string.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.
  NullPointerException | file, func, or msg is null.

## ◆ H5Eregister_class()

synchronized native long H5Eregister_class | ( | String | cls_name,
|  | String | lib_name,
|  | String | version ) throws HDF5LibraryException, NullPointerException
| static

H5Eregister_class registers a client library or application program to the HDF5 error API so that the client library or application program can report errors together with HDF5 library.

Parameters

  cls_name | IN: Name of the error class.
  lib_name | IN: Name of the client library or application to which the error class belongs.
  version | IN: Version of the client library or application to which the error class belongs.

Returns
  a class identifier

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.
  NullPointerException | name is null.

## ◆ H5Eset_current_stack()

synchronized native void H5Eset_current_stack | ( | long | stack_id | ) | throws HDF5LibraryException
| static

H5Eset_current_stack replaces the content of the current error stack with a copy of the content of the error stack specified by estack_id.

Parameters

  stack_id | IN: Error stack identifier.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.

## ◆ H5Eunregister_class()

synchronized native void H5Eunregister_class | ( | long | class_id | ) | throws HDF5LibraryException
| static

H5Eunregister_class removes the error class specified by class_id.

Parameters

  class_id | IN: Error class identifier.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.

## ◆ H5Ewalk()

void H5Ewalk | ( | long | stack_id,
|  | long | direction,
|  | H5E_walk_cb | func,
|  | H5E_walk_t | client_data ) throws HDF5LibraryException, NullPointerException
| static

H5Ewalk walks the error stack specified by estack_id for the current thread and calls the function specified in func for each error along the way.

Parameters

  stack_id | IN: Error stack identifier.
  direction | IN: Direction in which the error stack is to be walked.
  func | IN: Function to be called for each error encountered.
  client_data | IN: Data to be passed with func.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.
  NullPointerException | func is null.

## ◆ H5Ewalk2()

synchronized native void H5Ewalk2 | ( | long | stack_id,
|  | long | direction,
|  | H5E_walk_cb | func,
|  | H5E_walk_t | client_data ) throws HDF5LibraryException, NullPointerException
| static

H5Ewalk2 walks the error stack specified by estack_id for the current thread and calls the function specified in func for each error along the way.

Parameters

  stack_id | IN: Error stack identifier.
  direction | IN: Direction in which the error stack is to be walked.
  func | IN: Function to be called for each error encountered.
  client_data | IN: Data to be passed with func.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.
  NullPointerException | func is null.