.. _program_listing_file_umap_util_Exception.cpp: Program Listing for File Exception.cpp ====================================== |exhale_lsh| :ref:`Return to documentation for file ` (``umap/util/Exception.cpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp ////////////////////////////////////////////////////////////////////////////// // Copyright 2017-2020 Lawrence Livermore National Security, LLC and other // UMAP Project Developers. See the top-level LICENSE file for details. // // SPDX-License-Identifier: LGPL-2.1-only ////////////////////////////////////////////////////////////////////////////// #include "umap/util/Exception.hpp" #include namespace Umap { Exception::Exception( const std::string& message, const std::string &file, int line) : m_message(message), m_file(file), m_line(line) { m_what = this->message(); } std::string Exception::message() const { std::stringstream oss; oss << "! UMAP Exception [" << m_file << ":" << m_line << "]: "; oss << m_message; return oss.str(); } const char* Exception::what() const throw() { return m_what.c_str(); } } // end of namespace Umap