Loading...
Searching...
No Matches
pappsoexception.h
Go to the documentation of this file.
/**
* \file pappsomspp/pappsoexception.cpp
* \date 10/3/2015
* \author Olivier Langella
* \brief exception handler
*/
/*******************************************************************************
* Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>.
*
* This file is part of the PAPPSOms++ library.
*
* PAPPSOms++ 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.
*
* PAPPSOms++ 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 PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
*implementation
******************************************************************************/
#pragma once
#include <exception>
#include <QString>
#include <QDebug>
#include <QException>
namespace pappso
{
class PappsoException : public QException
{
public:
PappsoException(const QString &message) throw()
{
qDebug() << message;
m_message = message;
m_stdMessage.assign(m_message.toStdString());
}
PappsoException(const PappsoException &other) throw()
{
m_message = other.m_message;
m_stdMessage.assign(m_message.toStdString());
}
void
raise() const override
{
throw *this;
}
virtual QException *
clone() const override
{
return new PappsoException(*this);
}
virtual const QString &
qwhat() const throw()
{
return m_message;
}
const char *
what() const noexcept override
{
return m_stdMessage.c_str();
}
virtual ~PappsoException() throw()
{
}
private:
std::string m_stdMessage;
QString m_message; // Description of the error
};
} // namespace pappso
pappso::PappsoException
Definition pappsoexception.h:42
pappso::PappsoException::PappsoException
PappsoException(const PappsoException &other)
Definition pappsoexception.h:51
pappso::PappsoException::PappsoException
PappsoException(const QString &message)
Definition pappsoexception.h:44
pappso::PappsoException::clone
virtual QException * clone() const override
Definition pappsoexception.h:62
pappso::PappsoException::m_message
QString m_message
Definition pappsoexception.h:85
pappso::PappsoException::what
const char * what() const noexcept override
Definition pappsoexception.h:74
pappso::PappsoException::qwhat
virtual const QString & qwhat() const
Definition pappsoexception.h:68
pappso::PappsoException::raise
void raise() const override
Definition pappsoexception.h:57
pappso::PappsoException::m_stdMessage
std::string m_stdMessage
Definition pappsoexception.h:84
pappso::PappsoException::~PappsoException
virtual ~PappsoException()
Definition pappsoexception.h:79
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39