Skip to content

Commit 25b5225

Browse files
committed
Always catch-by-reference in C++11
1 parent cb6ac21 commit 25b5225

19 files changed

+26
-26
lines changed

src/CacheDisk.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ void CacheDisk::SetJson(string value) {
522522
// Set all values that match
523523
SetJsonValue(root);
524524
}
525-
catch (exception e)
525+
catch (const std::exception& e)
526526
{
527527
// Error parsing JSON (or missing keys)
528528
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");

src/CacheMemory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ void CacheMemory::SetJson(string value) {
377377
// Set all values that match
378378
SetJsonValue(root);
379379
}
380-
catch (exception e)
380+
catch (const std::exception& e)
381381
{
382382
// Error parsing JSON (or missing keys)
383383
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");

src/ChunkReader.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void ChunkReader::load_json()
121121
info.audio_timebase.den = root["audio_timebase"]["den"].asInt();
122122

123123
}
124-
catch (exception e)
124+
catch (const std::exception& e)
125125
{
126126
// Error parsing JSON (or missing keys)
127127
throw InvalidJSON("JSON could not be parsed (or is invalid).", path);
@@ -235,7 +235,7 @@ std::shared_ptr<Frame> ChunkReader::GetFrame(int64_t requested_frame)
235235
local_reader = new FFmpegReader(chunk_video_path);
236236
local_reader->Open(); // open reader
237237

238-
} catch (InvalidFile)
238+
} catch (const InvalidFile& e)
239239
{
240240
// Invalid Chunk (possibly it is not found)
241241
throw ChunkNotFound(path, requested_frame, location.number, location.frame);
@@ -298,7 +298,7 @@ void ChunkReader::SetJson(string value) {
298298
// Set all values that match
299299
SetJsonValue(root);
300300
}
301-
catch (exception e)
301+
catch (const std::exception& e)
302302
{
303303
// Error parsing JSON (or missing keys)
304304
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");

src/Clip.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void Clip::init_reader_rotation() {
123123
try {
124124
float rotate_metadata = strtof(reader->info.metadata["rotate"].c_str(), 0);
125125
rotation = Keyframe(rotate_metadata);
126-
} catch (exception e) {}
126+
} catch (const std::exception& e) {}
127127
}
128128
else
129129
// Default no rotation
@@ -809,7 +809,7 @@ void Clip::SetJson(string value) {
809809
// Set all values that match
810810
SetJsonValue(root);
811811
}
812-
catch (exception e)
812+
catch (const std::exception& e)
813813
{
814814
// Error parsing JSON (or missing keys)
815815
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");

src/Color.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void Color::SetJson(string value) {
125125
// Set all values that match
126126
SetJsonValue(root);
127127
}
128-
catch (exception e)
128+
catch (const std::exception& e)
129129
{
130130
// Error parsing JSON (or missing keys)
131131
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");

src/Coordinate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void Coordinate::SetJson(string value) {
8888
// Set all values that match
8989
SetJsonValue(root);
9090
}
91-
catch (exception e)
91+
catch (const std::exception& e)
9292
{
9393
// Error parsing JSON (or missing keys)
9494
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");

src/DecklinkReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ void DecklinkReader::SetJson(string value) {
283283
// Set all values that match
284284
SetJsonValue(root);
285285
}
286-
catch (exception e)
286+
catch (const std::exception& e)
287287
{
288288
// Error parsing JSON (or missing keys)
289289
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");

src/DummyReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ void DummyReader::SetJson(string value) {
161161
// Set all values that match
162162
SetJsonValue(root);
163163
}
164-
catch (exception e)
164+
catch (const std::exception& e)
165165
{
166166
// Error parsing JSON (or missing keys)
167167
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");

src/EffectBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void EffectBase::SetJson(string value) {
117117
// Set all values that match
118118
SetJsonValue(root);
119119
}
120-
catch (exception e)
120+
catch (const std::exception& e)
121121
{
122122
// Error parsing JSON (or missing keys)
123123
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");

src/FFmpegReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2439,7 +2439,7 @@ void FFmpegReader::SetJson(string value) {
24392439
// Set all values that match
24402440
SetJsonValue(root);
24412441
}
2442-
catch (exception e) {
2442+
catch (const std::exception& e) {
24432443
// Error parsing JSON (or missing keys)
24442444
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");
24452445
}

0 commit comments

Comments
 (0)