diff --git a/src/clientdlg.cpp b/src/clientdlg.cpp index 8a455762..0d2560dd 100755 --- a/src/clientdlg.cpp +++ b/src/clientdlg.cpp @@ -1079,7 +1079,7 @@ void CClientDlg::Connect ( const QString& strSelectedAddress, } } - catch ( CGenErr generr ) + catch ( const CGenErr& generr ) { // show error message and return the function QMessageBox::critical ( this, APP_NAME, generr.GetErrorText(), "Close", nullptr ); diff --git a/src/global.h b/src/global.h index 4a09bc95..20ef60cc 100755 --- a/src/global.h +++ b/src/global.h @@ -282,7 +282,7 @@ public: CGenErr ( QString strNewErrorMsg, QString strNewErrorType = "" ) : strErrorMsg ( strNewErrorMsg ), strErrorType ( strNewErrorType ) {} - QString GetErrorText() + QString GetErrorText() const { // return formatted error text if ( strErrorType.isEmpty() ) diff --git a/src/main.cpp b/src/main.cpp index 251ec0d0..67703a9c 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -706,7 +706,7 @@ int main ( int argc, char** argv ) } } - catch ( CGenErr generr ) + catch ( const CGenErr& generr ) { // show generic error #ifndef HEADLESS