Merge pull request #395 from stweil/master
Catch a CGenErr by const reference rather than by value
This commit is contained in:
commit
faef894057
3 changed files with 3 additions and 3 deletions
|
@ -1079,7 +1079,7 @@ void CClientDlg::Connect ( const QString& strSelectedAddress,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
catch ( CGenErr generr )
|
catch ( const CGenErr& generr )
|
||||||
{
|
{
|
||||||
// show error message and return the function
|
// show error message and return the function
|
||||||
QMessageBox::critical ( this, APP_NAME, generr.GetErrorText(), "Close", nullptr );
|
QMessageBox::critical ( this, APP_NAME, generr.GetErrorText(), "Close", nullptr );
|
||||||
|
|
|
@ -282,7 +282,7 @@ public:
|
||||||
CGenErr ( QString strNewErrorMsg, QString strNewErrorType = "" ) :
|
CGenErr ( QString strNewErrorMsg, QString strNewErrorType = "" ) :
|
||||||
strErrorMsg ( strNewErrorMsg ), strErrorType ( strNewErrorType ) {}
|
strErrorMsg ( strNewErrorMsg ), strErrorType ( strNewErrorType ) {}
|
||||||
|
|
||||||
QString GetErrorText()
|
QString GetErrorText() const
|
||||||
{
|
{
|
||||||
// return formatted error text
|
// return formatted error text
|
||||||
if ( strErrorType.isEmpty() )
|
if ( strErrorType.isEmpty() )
|
||||||
|
|
|
@ -706,7 +706,7 @@ int main ( int argc, char** argv )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
catch ( CGenErr generr )
|
catch ( const CGenErr& generr )
|
||||||
{
|
{
|
||||||
// show generic error
|
// show generic error
|
||||||
#ifndef HEADLESS
|
#ifndef HEADLESS
|
||||||
|
|
Loading…
Reference in a new issue