summaryrefslogtreecommitdiff
path: root/src/utils/errors.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/errors.cpp')
-rw-r--r--src/utils/errors.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/utils/errors.cpp b/src/utils/errors.cpp
new file mode 100644
index 0000000..1baaaeb
--- /dev/null
+++ b/src/utils/errors.cpp
@@ -0,0 +1,33 @@
+////////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 2018 Leo Tenenbaum
+// This file is part of GraphColoring.
+//
+// GraphColoring is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// GraphColoring is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with GraphColoring. If not, see <https://www.gnu.org/licenses/>.
+////////////////////////////////////////////////////////////////////////////////
+
+#include "errors.hpp"
+
+#include <iostream>
+
+namespace utils {
+namespace errors {
+
+void Die(std::string error_message)
+{
+ std::cerr << "Error: " << error_message << std::endl;
+ std::exit(EXIT_FAILURE);
+}
+
+} // namespace errors
+} // namespace utils