Always catch-by-reference in C++11

This commit is contained in:
FeRD (Frank Dana)
2019-07-03 12:58:02 -04:00
parent cb6ac21219
commit 25b522589d
19 changed files with 26 additions and 26 deletions

View File

@@ -67,7 +67,7 @@ void ImageReader::Open()
image->backgroundColor(Magick::Color("none"));
MAGICK_IMAGE_ALPHA(image, true);
}
catch (Magick::Exception e) {
catch (const Magick::Exception& e) {
// raise exception
throw InvalidFile("File could not be opened.", path);
}
@@ -174,7 +174,7 @@ void ImageReader::SetJson(string value) {
// Set all values that match
SetJsonValue(root);
}
catch (exception e)
catch (const std::exception& e)
{
// Error parsing JSON (or missing keys)
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");