Merge pull request #265 from ferdnyc/catch-by-reference

Exceptions: catch-by-reference and other cleanup
This commit is contained in:
Jonathan Thomas
2019-07-29 16:27:40 -05:00
committed by GitHub
35 changed files with 104 additions and 109 deletions

View File

@@ -200,7 +200,7 @@ Point Keyframe::GetPreviousPoint(Point p) {
else
return Points[0];
} catch (OutOfBoundsPoint) {
} catch (const OutOfBoundsPoint& e) {
// No previous point
return Point(-1, -1);
}
@@ -386,7 +386,7 @@ void Keyframe::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)", "");