LibrePCB Developers Documentation
|
The UserCanceled class. More...
#include <exceptions.h>
Public Member Functions | |
UserCanceled ()=delete | |
Default Constructor. More... | |
UserCanceled (const char *file, int line, const QString &msg=QString("User Canceled")) noexcept | |
The default constructor. More... | |
UserCanceled (const UserCanceled &other) noexcept | |
The copy constructor (needed for clone()) More... | |
virtual void | raise () const override |
virtual UserCanceled * | clone () const override |
Public Member Functions inherited from Exception | |
Exception ()=delete | |
The default constructor. More... | |
Exception (const Exception &other) noexcept | |
The copy constructor (needed for clone()) More... | |
Exception (const char *file, int line, const QString &msg=QString("Exception")) noexcept | |
The constructor which is used to throw an exception. More... | |
virtual | ~Exception () noexcept |
The destructor. More... | |
const QString & | getMsg () const |
Get the error message (translated) More... | |
const QString & | getFile () const |
Get the source file where the exception was thrown. More... | |
int | getLine () const |
Get the line number where the exception was thrown. More... | |
const char * | what () const noexcept override |
reimplemented from std::exception::what() More... | |
virtual void | raise () const override |
virtual Exception * | clone () const override |
The UserCanceled class.
This exception class is used to interrupt an action which was canceled by the user. This type of exception is useful if the exception catcher do not need to show a message box with the error message. For example, if a project is opened, the project's constructor will throw an exception in case of an error. Then the caller (the catcher of the exception) will show a message box with the error message. But the constructor can also throw an exception if the user has canceled opening the project (for example in a message box "restore project?" --> YES|NO|CANCEL). But then the error message box do not need to appear! So we can throw an exception of type "UserCanceled" to indicate that this was a user's decision and the catcher will not show an error message box.
|
delete |
Default Constructor.
|
noexcept |
The default constructor.
|
noexcept |
The copy constructor (needed for clone())
|
inlineoverridevirtual |
Reimplemented from Exception.
|
inlineoverridevirtual |