Make exceptions more concise.
Created by: rkube
Hi, working with adios I came along a confusing exception. Basically, I tried to access a variable without having a file open.
import adios2
adios = adios2.ADIOS()
ioread = adios.DeclareIO("reader")
res = ioread.InquireVariable("ECEI_L2408")
In [9]: type(res)
Out[9]: adios2.Variable
In [11]: res.Shape()
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-11-a8250f87005c> in <module>
----> 1 res.Shape()
ValueError: ERROR: found null pointer in call to Variable::Shape
In [15]: res.Steps()
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-15-a39dc5e97e8d> in <module>
----> 1 res.Steps()
ValueError: ERROR: found null pointer in call to Variable::Steps
Of course there is no file open to inquire from. But I think the error message could be made so that it gives a hint as to what is wrong.
Another thing is accessing BP4 files. I tried this code to open the BP4 file "KSTAR.bp":
import adios2
adios = adios2.ADIOS()
ioread = adios.DeclareIO("reader")
bpStream = ioread.Open("KSTAR.bp", adios2.Mode.Read)
Traceback (most recent call last):
File "verify_kstarbp.py", line 6, in <module>
bpStream = ioread.Open("KSTAR.bp", adios2.Mode.Read)
RuntimeError: ERROR: couldn't read from file KSTAR.bp, in call to POSIX IO read
: iostream error
The error is that I try to open a BP4 file, probably with the wrong engine. It would be great if the error message would tell me what is wrong instead of giving just an iostream error.