MeteoSwiss-APN / serialbox

Data serialization library and tools for C/C++ and Fortran
BSD 2-Clause "Simplified" License
2 stars 6 forks source link

Add error in case .dat file is not present #59

Closed clementval closed 7 years ago

clementval commented 8 years ago

If the .dat file is not present, a segfault is thrown. A nice error message would be better.

This behavior has been seen from Fortran. I don't know if it has the same behavior if we use the C++ library only.

PallasKat commented 8 years ago

I add that if the .json file is missing (or misspelled prefix) we get an exception stating that the savepoint is missing instead of stating that the file is missing:

terminate called after throwing an instance of 'ser::SerializationException' what(): Error: the requested savepoint verif-radiation.input[ iteration=0 ] does not exist in the serializer.

havogt commented 7 years ago

Seems to be fixed in Serialbox2

Serialbox: ERROR: cannot open file: './SerialboxTest_ser_a.dat'

and

Serialbox: ERROR: cannot create Serializer: MetaData-SerialboxTest.json not found in "."