RDKit
Open-source cheminformatics and machine learning.
BadFileException.h
Go to the documentation of this file.
1 //
2 // Copyright 2003-2006 Greg Landrum and Rational Discovery LLC
3 //
4 // @@ All Rights Reserved @@
5 // This file is part of the RDKit.
6 // The contents are covered by the terms of the BSD license
7 // which is included in the file license.txt, found at the root
8 // of the RDKit source tree.
9 //
10 #include <RDGeneral/export.h>
11 #ifndef _RD_BADFILEEXCEPTION_H
12 #define _RD_BADFILEEXCEPTION_H
13 
14 #include <string>
15 #include <vector>
16 #include <stdexcept>
17 
18 namespace RDKit {
19 
20 //! used by various file parsing classes to indicate a bad file
21 class BadFileException : public std::runtime_error {
22  public:
23  //! construct with an error message
24  explicit BadFileException(const char *msg)
25  : std::runtime_error("BadFileException"), _msg(msg){};
26  //! construct with an error message
27  explicit BadFileException(const std::string &msg)
28  : std::runtime_error("BadFileException"), _msg(msg){};
29  //! get the error message
30  const char *what() const noexcept override { return _msg.c_str(); };
31  const char *message() const noexcept { return what(); };
32  ~BadFileException() noexcept {};
33 
34  private:
35  std::string _msg;
36 };
37 } // namespace RDKit
38 
39 #endif
RDKit::BadFileException::BadFileException
BadFileException(const std::string &msg)
construct with an error message
Definition: BadFileException.h:27
RDKit::BadFileException::what
const char * what() const noexcept override
get the error message
Definition: BadFileException.h:30
RDKit
Std stuff.
Definition: Atom.h:30
RDKit::BadFileException::~BadFileException
~BadFileException() noexcept
Definition: BadFileException.h:32
RDKit::BadFileException
used by various file parsing classes to indicate a bad file
Definition: BadFileException.h:21
RDKit::BadFileException::BadFileException
BadFileException(const char *msg)
construct with an error message
Definition: BadFileException.h:24
RDKit::BadFileException::message
const char * message() const noexcept
Definition: BadFileException.h:31
export.h