PVS-Studio: An exception should be caught by reference rather than by value. (#6003)

This commit is contained in:
Svyatoslav 2017-05-05 03:34:34 +03:00 committed by Andrew Nelless
parent 30baa8fbe1
commit cd015482d5
2 changed files with 2 additions and 2 deletions

View File

@ -820,7 +820,7 @@ Client::sendFileThread(void* filename)
char* name = static_cast<char*>(filename);
StreamChunker::sendFile(name, m_events, this);
}
catch (std::runtime_error error) {
catch (std::runtime_error& error) {
LOG((CLOG_ERR "failed sending file chunks: %s", error.what()));
}

View File

@ -2392,7 +2392,7 @@ Server::sendFileThread(void* data)
LOG((CLOG_DEBUG "sending file to client, filename=%s", filename));
StreamChunker::sendFile(filename, m_events, this);
}
catch (std::runtime_error error) {
catch (std::runtime_error &error) {
LOG((CLOG_ERR "failed sending file chunks, error: %s", error.what()));
}