HDF Errors in .NET

Has anyone had success getting HDF5 error information from within a .NET project?

There are only two functions wrapped in the HDF5DotNet.H5E class: supressPrinting & setAuto. It seems setAuto would alert a delegate when an error occurs, but with no real information.

Currently HDF error messages don't print. I suspect this is a C vs. C# managed .NET thing. Ideally I'd like to get the error string to use in my own error management system; but just pushing it to stdout/stderr, one that shows, would be a help.

Happy Holidays all,
Scott

···

________________________________
This e-mail and any files transmitted with it may be proprietary and are intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the sender.
Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of ITT Corporation. The recipient should check this e-mail and any attachments for the presence of viruses. ITT accepts no liability for any damage caused by any virus transmitted by this e-mail.

I believe that it does work. If you want to capture the error message, put a try/catch block around the code where you want to capture the errors. Then in the catch, section catch the errors you want to process or catch all. I can't recall the exact names off the top of my head, but it would look something like:

try
{
// some code here;
}
catch (H5FileException ex)
{
// do some error handling
}
catch (H5LException ex)
{
// different error handling
}

I'm doing something similar when trying to load an attribute because the H5L.exists function doesn't exist in the .NET wrapper (hint, hint :-))

Jesse

Mitchell, Scott - AES wrote:

···

Has anyone had success getting HDF5 error information from within a .NET project?

There are only two functions wrapped in the HDF5DotNet.H5E class: supressPrinting & setAuto. It seems setAuto would alert a delegate when an error occurs, but with no real information.

Currently HDF error messages don�t print. I suspect this is a C vs. C# managed .NET thing. Ideally I�d like to get the error string to use in my own error management system; but just pushing it to stdout/stderr, one that shows, would be a help.

Happy Holidays all,

Scott

------------------------------------------------------------------------
This e-mail and any files transmitted with it may be proprietary and are intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the sender.
Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of ITT Corporation. The recipient should check this e-mail and any attachments for the presence of viruses. ITT accepts no liability for any damage caused by any virus transmitted by this e-mail.
------------------------------------------------------------------------

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Hi Jesse,

Yes you should catch the exceptions, but it only gives you very gross level of error, not what the C code gives.

For example, I'm currently trying to figure out why I can't create an HDF file to a particular folder. I get a H5FcreateException from H5F::create, but that tells me nothing other than that the function failed, not why.

Free space? Permissions? Path error?

As it turns out I can create a simple text file to that same location, so I'm guessing none of the above.

S

···

-----Original Message-----
From: hdf-forum-bounces@hdfgroup.org [mailto:hdf-forum-bounces@hdfgroup.org]
On Behalf Of Jesse Lai
Sent: Monday, December 21, 2009 9:20 PM
To: hdf-forum@hdfgroup.org
Subject: Re: [Hdf-forum] HDF Errors in .NET

I believe that it does work. If you want to capture the error message,
put a try/catch block around the code where you want to capture the
errors. Then in the catch, section catch the errors you want to process
or catch all. I can't recall the exact names off the top of my head, but
it would look something like:

try
{
// some code here;
}
catch (H5FileException ex)
{
// do some error handling
}
catch (H5LException ex)
{
// different error handling
}

I'm doing something similar when trying to load an attribute because the
H5L.exists function doesn't exist in the .NET wrapper (hint, hint :-))

Jesse

Mitchell, Scott - AES wrote:
>
> Has anyone had success getting HDF5 error information from within a
> .NET project?
>
> There are only two functions wrapped in the HDF5DotNet.H5E class:
> supressPrinting & setAuto. It seems setAuto would alert a delegate
> when an error occurs, but with no real information.
>
> Currently HDF error messages don't print. I suspect this is a C vs. C#
> managed .NET thing. Ideally I'd like to get the error string to use in
> my own error management system; but just pushing it to stdout/stderr,
> one that shows, would be a help.
>
> Happy Holidays all,
>
> Scott
>
>
> ------------------------------------------------------------------------
> This e-mail and any files transmitted with it may be proprietary and
> are intended solely for the use of the individual or entity to whom
> they are addressed. If you have received this e-mail in error please
> notify the sender.
> Please note that any views or opinions presented in this e-mail are
> solely those of the author and do not necessarily represent those of
> ITT Corporation. The recipient should check this e-mail and any
> attachments for the presence of viruses. ITT accepts no liability for
> any damage caused by any virus transmitted by this e-mail.
> ------------------------------------------------------------------------
>
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> Hdf-forum@hdfgroup.org
> http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
>

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org