libpappsomspp
Library for mass spectrometry
pappsoexception.h
Go to the documentation of this file.
1 /**
2  * \file pappsomspp/pappsoexception.cpp
3  * \date 10/3/2015
4  * \author Olivier Langella
5  * \brief exception handler
6  */
7 
8 /*******************************************************************************
9  * Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>.
10  *
11  * This file is part of the PAPPSOms++ library.
12  *
13  * PAPPSOms++ is free software: you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation, either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * PAPPSOms++ is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
25  *
26  * Contributors:
27  * Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
28  *implementation
29  ******************************************************************************/
30 
31 
32 #pragma once
33 
34 #include <exception>
35 #include <QString>
36 #include <QDebug>
37 #include <QException>
38 
39 namespace pappso
40 {
41 class PappsoException : public QException
42 {
43  public:
44  PappsoException(const QString &message) throw()
45  {
46  qDebug() << message;
48  }
49 
50  PappsoException(const PappsoException &other) throw()
51  {
52  m_message = other.m_message;
53  }
54  void
55  raise() const override
56  {
57  throw *this;
58  }
59  virtual QException *
60  clone() const override
61  {
62  return new PappsoException(*this);
63  }
64 
65  virtual const QString &
66  qwhat() const throw()
67  {
68  return m_message;
69  }
70 
71  virtual const char *
72  what() const throw() override
73  {
74  return m_message.toStdString().c_str();
75  }
76 
77  virtual ~PappsoException() throw()
78  {
79  }
80 
81  private:
82  QString m_message; // Description of the error
83 };
84 } // namespace pappso
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
pappso::PappsoException::~PappsoException
virtual ~PappsoException()
Definition: pappsoexception.h:119
pappso::PappsoException::m_message
QString m_message
Definition: pappsoexception.h:124
message
message(\n${BoldRed}"Now configuring src/widget for ${PROJECT_NAME}"${ColourReset}\n) find_package(Qt5 COMPONENTS Core Gui PrintSupport Svg REQUIRED) if(NOT QCustomPlot_FOUND) message("Still searching for QCustomPlot") find_package(QCustomPlot REQUIRED) add_definitions(-DQCUSTOMPLOT_USE_LIBRARY) endif() SET(PAPPSOWIDGET_CPP_FILES graphicdevicewidget.cpp precisionwidget/precisionwidget.cpp massspectrumwidget/qcpspectrum.cpp massspectrumwidget/massspectrumwidget.cpp xicwidget/qcpxic.cpp xicwidget/xicwidget.cpp plotwidget/colormapplotconfig.cpp plotwidget/baseplotwidget.cpp plotwidget/basetraceplotwidget.cpp plotwidget/ticxicchromtraceplotwidget.cpp plotwidget/massspectraceplotwidget.cpp plotwidget/driftspectraceplotwidget.cpp plotwidget/basecolormapplotwidget.cpp plotwidget/ticxicchrommassspeccolormapplotwidget.cpp plotwidget/ticxicchromdriftspeccolormapplotwidget.cpp plotwidget/driftspecmassspeccolormapplotwidget.cpp) add_library(pappsomspp-widget-static STATIC $
Definition: CMakeLists.txt:6
pappso::PappsoException::qwhat
virtual const QString & qwhat() const
Definition: pappsoexception.h:108
pappso::PappsoException::clone
virtual QException * clone() const override
Definition: pappsoexception.h:102
pappso::PappsoException::what
virtual const char * what() const override
Definition: pappsoexception.h:114
pappso::PappsoException::PappsoException
PappsoException(const QString &message)
Definition: pappsoexception.h:86