drumstick 2.9.0
C++ MIDI libraries using Qt objects, idioms, and style.
ALSA Sequencer Exception

Exception class for ALSA Sequencer errors. More...

Classes

class  SequencerError
 Exception class for ALSA Sequencer errors. More...
 

Macros

#define DRUMSTICK_ALSA_CHECK_ERROR(x)   (checkErrorAndThrow((x),__PRETTY_FUNCTION__))
 This macro calls the check error function. More...
 
#define DRUMSTICK_ALSA_CHECK_WARNING(x)   (checkWarning((x),__PRETTY_FUNCTION__))
 This macro calls the check warning function. More...
 

Functions

int checkErrorAndThrow (int rc, const char *where)
 Checks the error code for severe errors. More...
 
int checkWarning (int rc, const char *where)
 Check the error code for warning errors. More...
 
 SequencerError (QString const &s, int rc)
 Constructor. More...
 
virtual const char * what () const noexcept override
 Retrieve a human readable error message. More...
 
QString qstrError () const
 Gets the human readable error message from the error code. More...
 
int code () const
 Gets the numeric error code. More...
 
const QString & location () const
 Gets the location of the error code as provided in the constructor. More...
 

Detailed Description

Exception class for ALSA Sequencer errors.

Macro Definition Documentation

◆ DRUMSTICK_ALSA_CHECK_ERROR

#define DRUMSTICK_ALSA_CHECK_ERROR (   x)    (checkErrorAndThrow((x),__PRETTY_FUNCTION__))

This macro calls the check error function.

Parameters
xError code

Definition at line 80 of file errorcheck.h.

◆ DRUMSTICK_ALSA_CHECK_WARNING

#define DRUMSTICK_ALSA_CHECK_WARNING (   x)    (checkWarning((x),__PRETTY_FUNCTION__))

This macro calls the check warning function.

Parameters
xError code

Definition at line 86 of file errorcheck.h.

Function Documentation

◆ checkErrorAndThrow()

int checkErrorAndThrow ( int  rc,
const char *  where 
)
inline

Checks the error code for severe errors.

If the provided error code is less than zero an exception is thrown, containing both the error code and the location.

Parameters
rcError code
whereLocation
Returns
Error code

Definition at line 50 of file errorcheck.h.

◆ checkWarning()

int checkWarning ( int  rc,
const char *  where 
)
inline

Check the error code for warning errors.

This method doesn't throw an exception.

Parameters
rcError code
whereLocation
Returns
Error code

Definition at line 67 of file errorcheck.h.

◆ code()

int code ( ) const

Gets the numeric error code.

Returns
Error code
Examples
drumgrid.cpp, dumpmid.cpp, and metronome.cpp.

Definition at line 49 of file sequencererror.cpp.

◆ location()

const QString & location ( ) const

Gets the location of the error code as provided in the constructor.

Returns
Error location
Examples
drumgrid.cpp, dumpmid.cpp, and metronome.cpp.

Definition at line 54 of file sequencererror.cpp.

◆ qstrError()

QString qstrError ( ) const

Gets the human readable error message from the error code.

Returns
Error message
Examples
drumgrid.cpp, dumpmid.cpp, metronome.cpp, and sysinfo.cpp.

Definition at line 44 of file sequencererror.cpp.

References SequencerError::what().

◆ SequencerError()

SequencerError ( QString const &  s,
int  rc 
)

Constructor.

Parameters
sError location
rcNumeric error code

Definition at line 36 of file sequencererror.cpp.

◆ what()

const char * what ( ) const
overridevirtualnoexcept

Retrieve a human readable error message.

Returns
human readable error message

Definition at line 39 of file sequencererror.cpp.

Referenced by SequencerError::qstrError().