Skip to content

Commit

Permalink
added save path assertion.
Browse files Browse the repository at this point in the history
  • Loading branch information
Giorgi Lomia committed Oct 11, 2021
1 parent fc23430 commit ad7631c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tools/graph-stats/graph-memory-stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <arrow/type_traits.h>

#include "katana/ArrowVisitor.h"
#include "katana/ErrorCode.h"
#include "katana/Galois.h"
#include "katana/JSON.h"
#include "katana/Logging.h"
Expand Down Expand Up @@ -138,6 +139,13 @@ SaveToJson(
}

myfile.open(path_to_save);

if (!myfile) {
return KATANA_ERROR(
katana::ErrorCode::ArrowError, "Could not open file at {}",
path_to_save);
}

myfile << serialized;
myfile.close();
return katana::ResultSuccess();
Expand Down

0 comments on commit ad7631c

Please sign in to comment.