Skip to content

Commit

Permalink
[release/1.9.0][record-minmax] Handling error when data file is not H…
Browse files Browse the repository at this point in the history
…DF5 (#4204)

* [release/1.9.0][record-minmax] Handling error when data file is not HDF5

This commit will add error handling code when data file is not HDF5.

ONE-DCO-1.0-Signed-off-by: Seok NamKoong <[email protected]>

* revise msg

* revise 2
  • Loading branch information
llFreetimell authored Sep 11, 2020
1 parent b4aee2e commit b07033d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions compiler/record-minmax/src/HDF5Importer.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ namespace record_minmax
class HDF5Importer
{
public:
explicit HDF5Importer(const std::string &path) : _file{path, H5F_ACC_RDONLY}
explicit HDF5Importer(const std::string &path)
{
// Do nothing
if (_file.isHdf5(path) == false)
throw std::runtime_error("Error: Given data file is not HDF5");

_file = H5::H5File(path, H5F_ACC_RDONLY);
}

public:
Expand Down

0 comments on commit b07033d

Please sign in to comment.