NAPISD
PAHdb website C++ backend
Loading...
Searching...
No Matches
Exception.h
1#ifndef EXCEPTION_H_
2#define EXCEPTION_H_
3
4#include <ctime>
5#include <exception>
6#include <string>
7#include <string_view>
8
9class Exception : public std::exception {
10
11public:
12 Exception(const std::string_view message = "Undefined exception")
13 : std::exception() {
14
15 time_t t = std::time(nullptr);
16
17 struct tm *tm_s = std::localtime(&t);
18
19 char str_t[32];
20
21 std::strftime(str_t, sizeof(str_t), "%Y%m%d-%X - EXCEPTION: ", tm_s);
22
23 _message = std::string(str_t).append(message);
24 }
25
26 ~Exception() throw() {}
27
28 const char *what() const throw() override;
29
30private:
31 std::string _message;
32};
33
34inline const char *Exception::what() const throw() {
35
36 return (_message.c_str());
37}
38
39#endif /* EXCEPTION_H_ */

Since FY2019 the NASA Ames PAH IR Spectroscopic Database is being supported through a directed Work Package at NASA Ames titled: "Laboratory Astrophysics - The NASA Ames PAH IR Spectroscopic Database".
Since FY2023 the NASA Ames PAH IR Spectroscopic Database is being supported through the Laboratory Astrophysics Rd 2 directed Work Package at NASA Ames.
© Copyright 2021-2025, Christiaan Boersma