# Suppressing error output?

**URL:** <https://forum.hdfgroup.org/t/suppressing-error-output/9797>\
**Category:** HDF5 Library\
**Created:** [May 24, 2022, 8:27pm UTC](https://forum.hdfgroup.org/t/suppressing-error-output/9797 "2022-05-24T20:27:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![howard.eglowstein](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/h/73ab20/32.png) [@howard.eglowstein](https://forum.hdfgroup.org/u/howard.eglowstein)\
**Post date:** [May 24, 2022, 8:27pm UTC](https://forum.hdfgroup.org/t/suppressing-error-output/9797/1 "2022-05-24T20:27:10Z")

</div>

I’m using HDF5 with NI’s CVI/LabWindows. It works fine, but I need to suppress any error output. My application is a command line. I’m using a camera application that saves images as numbered entries in the HDF file, and the only way IO can find to see how many there are is to start opening them sequentially and stopping when i get an error. That works fine. The problem is that if I have 16 frames (for example), when I open frame 17 and get an error, HDF spews text all over the console. I get the error code and know I only have 16 but the console is covered with “Object not found” messages.

Can I suppress them? Is there a function to tell HDF not to display? Or do I need to remove the error reporting code and rebuild the library? Any suggestions would be appreciated.

Thanks!

---

<div class="post-metadata">

**Author:** ![gheber](https://forum.hdfgroup.org/user_avatar/forum.hdfgroup.org/gheber/32/1919_2.png) [@gheber](https://forum.hdfgroup.org/u/gheber)\
**Post date:** [May 24, 2022, 9:26pm UTC](https://forum.hdfgroup.org/t/suppressing-error-output/9797/2 "2022-05-24T21:26:16Z")

</div>

[`H5Eset_auto2(H5E_DEFAULT, NULL, NULL)`](https://docs.hdfgroup.org/hdf5/develop/group___h5_e.html#gaf0d6b18cd5160517fe5165b9a8443c69) should do the trick. G.

---

<div class="post-metadata">

**Author:** ![howard.eglowstein](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/h/73ab20/32.png) [@howard.eglowstein](https://forum.hdfgroup.org/u/howard.eglowstein)\
**Post date:** [May 25, 2022, 1:42pm UTC](https://forum.hdfgroup.org/t/suppressing-error-output/9797/3 "2022-05-25T13:42:21Z")

</div>

Awesome! It should indeed. I expected there was some sort of switch.

In the interim I found other functions that make my counting the objects a lot easier and faster. Rather than iterating and waiting for the error I am now able to query the object count. This forum really is an amazing resource.

Thanks!!!
