From 65d03aa50e85f249e4cb34ecd1408c97e26057f5 Mon Sep 17 00:00:00 2001 From: MoAlyousef Date: Fri, 11 Sep 2020 18:14:44 +0300 Subject: [PATCH] add missing header --- src/build.cpp | 3 +++ src/gen.cpp | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/build.cpp b/src/build.cpp index 66ab373..350ab87 100644 --- a/src/build.cpp +++ b/src/build.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include namespace cmkr::build { @@ -53,6 +54,8 @@ int run(int argc, char **argv) { int cmkr_build_run(int argc, char **argv) { try { return cmkr::build::run(argc, argv); + } catch (const std::system_error &e) { + return e.code().value(); } catch (...) { return cmkr::error::Status(cmkr::error::Status::Code::BuildError); } diff --git a/src/gen.cpp b/src/gen.cpp index 165d0e7..57fb36a 100644 --- a/src/gen.cpp +++ b/src/gen.cpp @@ -13,7 +13,6 @@ #include #include - namespace fs = std::filesystem; namespace cmkr::gen { @@ -233,6 +232,8 @@ int generate_cmake(const char *path) { int cmkr_gen_generate_project(const char *typ) { try { return cmkr::gen::generate_project(typ); + } catch (const std::system_error &e) { + return e.code().value(); } catch (...) { return cmkr::error::Status(cmkr::error::Status::Code::InitError); } @@ -241,6 +242,8 @@ int cmkr_gen_generate_project(const char *typ) { int cmkr_gen_generate_cmake(const char *path) { try { return cmkr::gen::generate_cmake(path); + } catch (const std::system_error &e) { + return e.code().value(); } catch (...) { return cmkr::error::Status(cmkr::error::Status::Code::GenerationError); }