diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2018-05-16 20:02:43 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2018-05-16 20:02:43 (GMT) |
commit | 37e4607b917c045311ab682cc65b34b21da56e3d (patch) | |
tree | 284001cebd4cef228b1043d0a5e186163df7db0f /java/test | |
parent | 84f1bf6eb16f204671c1561f1bef3e3ebf600aef (diff) | |
download | hdf5-37e4607b917c045311ab682cc65b34b21da56e3d.zip hdf5-37e4607b917c045311ab682cc65b34b21da56e3d.tar.gz hdf5-37e4607b917c045311ab682cc65b34b21da56e3d.tar.bz2 |
HDFFV-9739 Grab err number before API call
Diffstat (limited to 'java/test')
-rw-r--r-- | java/test/TestH5E.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/java/test/TestH5E.java b/java/test/TestH5E.java index d1f50cc..656069a 100644 --- a/java/test/TestH5E.java +++ b/java/test/TestH5E.java @@ -78,14 +78,15 @@ public class TestH5E { H5.H5Fopen("test", 0, 1); } catch (HDF5LibraryException hdferr) { + long errnum = hdferr.getMajorErrorNumber(); int[] error_msg_type = { HDF5Constants.H5E_MAJOR }; String msg = null; try { - msg = H5.H5Eget_msg(hdferr.getMajorErrorNumber(), error_msg_type); + msg = H5.H5Eget_msg(errnum, error_msg_type); } catch (Throwable err) { err.printStackTrace(); - fail("H5.H5Eget_msg: " + err); + fail("H5.H5Eget_msg(Throwable): " + err); } assertNotNull("H5.H5Eget_msg: " + msg, msg); assertEquals("H5.H5Eget_msg: ", "Object atom", msg); @@ -93,7 +94,7 @@ public class TestH5E { } catch (Throwable err) { err.printStackTrace(); - fail("H5.H5Eget_msg: " + err); + fail("H5.H5Eget_msg(Other): " + err); } } @@ -103,10 +104,11 @@ public class TestH5E { H5.H5Fopen("test", 0, 1); } catch (HDF5LibraryException hdferr) { + long errnum = hdferr.getMinorErrorNumber(); int[] error_msg_type = { HDF5Constants.H5E_MINOR }; String msg = null; try { - msg = H5.H5Eget_msg(hdferr.getMinorErrorNumber(), error_msg_type); + msg = H5.H5Eget_msg(errnum, error_msg_type); } catch (Throwable err) { err.printStackTrace(); |