diff --git a/include/Exceptions.h b/include/Exceptions.h index 0fb2bb1e..c5228f13 100644 --- a/include/Exceptions.h +++ b/include/Exceptions.h @@ -32,7 +32,6 @@ #define OPENSHOT_EXCEPTIONS_H #include -using namespace std; namespace openshot { @@ -45,11 +44,11 @@ namespace openshot { class BaseException : public std::exception //: public exception { protected: - string m_message; + std::string m_message; public: - BaseException(string message) : m_message(message) { } - virtual ~BaseException() throw () {} - virtual const char* what() const throw () { + BaseException(std::string message) : m_message(message) { } + virtual ~BaseException() noexcept {} + virtual const char* what() const noexcept { // return custom message return m_message.c_str(); } @@ -59,13 +58,12 @@ namespace openshot { class ChunkNotFound : public BaseException { public: - string file_path; int64_t frame_number; int64_t chunk_number; int64_t chunk_frame; - ChunkNotFound(string message, int64_t frame_number, int64_t chunk_number, int64_t chunk_frame) + ChunkNotFound(std::string message, int64_t frame_number, int64_t chunk_number, int64_t chunk_frame) : BaseException(message), frame_number(frame_number), chunk_number(chunk_number), chunk_frame(chunk_frame) { } - virtual ~ChunkNotFound() throw () {} + virtual ~ChunkNotFound() noexcept {} }; @@ -73,132 +71,129 @@ namespace openshot { class DecklinkError : public BaseException { public: - DecklinkError(string message) + DecklinkError(std::string message) : BaseException(message) { } - virtual ~DecklinkError() throw () {} + virtual ~DecklinkError() noexcept {} }; /// Exception when decoding audio packet class ErrorDecodingAudio : public BaseException { public: - string file_path; int64_t frame_number; - ErrorDecodingAudio(string message, int64_t frame_number) + ErrorDecodingAudio(std::string message, int64_t frame_number) : BaseException(message), frame_number(frame_number) { } - virtual ~ErrorDecodingAudio() throw () {} + virtual ~ErrorDecodingAudio() noexcept {} }; /// Exception when encoding audio packet class ErrorEncodingAudio : public BaseException { public: - string file_path; int64_t frame_number; - ErrorEncodingAudio(string message, int64_t frame_number) + ErrorEncodingAudio(std::string message, int64_t frame_number) : BaseException(message), frame_number(frame_number) { } - virtual ~ErrorEncodingAudio() throw () {} + virtual ~ErrorEncodingAudio() noexcept {} }; /// Exception when encoding audio packet class ErrorEncodingVideo : public BaseException { public: - string file_path; int64_t frame_number; - ErrorEncodingVideo(string message, int64_t frame_number) + ErrorEncodingVideo(std::string message, int64_t frame_number) : BaseException(message), frame_number(frame_number) { } - virtual ~ErrorEncodingVideo() throw () {} + virtual ~ErrorEncodingVideo() noexcept {} }; /// Exception when an invalid # of audio channels are detected class InvalidChannels : public BaseException { public: - string file_path; - InvalidChannels(string message, string file_path) + std::string file_path; + InvalidChannels(std::string message, std::string file_path) : BaseException(message), file_path(file_path) { } - virtual ~InvalidChannels() throw () {} + virtual ~InvalidChannels() noexcept {} }; /// Exception when no valid codec is found for a file class InvalidCodec : public BaseException { public: - string file_path; - InvalidCodec(string message, string file_path) + std::string file_path; + InvalidCodec(std::string message, std::string file_path) : BaseException(message), file_path(file_path) { } - virtual ~InvalidCodec() throw () {} + virtual ~InvalidCodec() noexcept {} }; /// Exception for files that can not be found or opened class InvalidFile : public BaseException { public: - string file_path; - InvalidFile(string message, string file_path) + std::string file_path; + InvalidFile(std::string message, std::string file_path) : BaseException(message), file_path(file_path) { } - virtual ~InvalidFile() throw () {} + virtual ~InvalidFile() noexcept {} }; /// Exception when no valid format is found for a file class InvalidFormat : public BaseException { public: - string file_path; - InvalidFormat(string message, string file_path) + std::string file_path; + InvalidFormat(std::string message, std::string file_path) : BaseException(message), file_path(file_path) { } - virtual ~InvalidFormat() throw () {} + virtual ~InvalidFormat() noexcept {} }; /// Exception for invalid JSON class InvalidJSON : public BaseException { public: - string file_path; - InvalidJSON(string message, string file_path) + std::string file_path; + InvalidJSON(std::string message, std::string file_path) : BaseException(message), file_path(file_path) { } - virtual ~InvalidJSON() throw () {} + virtual ~InvalidJSON() noexcept {} }; /// Exception when invalid encoding options are used class InvalidOptions : public BaseException { public: - string file_path; - InvalidOptions(string message, string file_path) + std::string file_path; + InvalidOptions(std::string message, std::string file_path) : BaseException(message), file_path(file_path) { } - virtual ~InvalidOptions() throw () {} + virtual ~InvalidOptions() noexcept {} }; /// Exception when invalid sample rate is detected during encoding class InvalidSampleRate : public BaseException { public: - string file_path; - InvalidSampleRate(string message, string file_path) + std::string file_path; + InvalidSampleRate(std::string message, std::string file_path) : BaseException(message), file_path(file_path) { } - virtual ~InvalidSampleRate() throw () {} + virtual ~InvalidSampleRate() noexcept {} }; /// Exception for missing JSON Change key class InvalidJSONKey : public BaseException { public: - string json; - InvalidJSONKey(string message, string json) + std::string json; + InvalidJSONKey(std::string message, std::string json) : BaseException(message), json(json) { } - virtual ~InvalidJSONKey() throw () {} + virtual ~InvalidJSONKey() noexcept {} }; /// Exception when no streams are found in the file class NoStreamsFound : public BaseException { public: - string file_path; - NoStreamsFound(string message, string file_path) + std::string file_path; + NoStreamsFound(std::string message, std::string file_path) : BaseException(message), file_path(file_path) { } - virtual ~NoStreamsFound() throw () {} + virtual ~NoStreamsFound() noexcept {} }; /// Exception for frames that are out of bounds. @@ -207,9 +202,9 @@ namespace openshot { public: int64_t FrameRequested; int64_t MaxFrames; - OutOfBoundsFrame(string message, int64_t frame_requested, int64_t max_frames) + OutOfBoundsFrame(std::string message, int64_t frame_requested, int64_t max_frames) : BaseException(message), FrameRequested(frame_requested), MaxFrames(max_frames) { } - virtual ~OutOfBoundsFrame() throw () {} + virtual ~OutOfBoundsFrame() noexcept {} }; /// Exception for an out of bounds key-frame point. @@ -218,59 +213,59 @@ namespace openshot { public: int PointRequested; int MaxPoints; - OutOfBoundsPoint(string message, int point_requested, int max_points) + OutOfBoundsPoint(std::string message, int point_requested, int max_points) : BaseException(message), PointRequested(point_requested), MaxPoints(max_points) { } - virtual ~OutOfBoundsPoint() throw () {} + virtual ~OutOfBoundsPoint() noexcept {} }; /// Exception when memory could not be allocated class OutOfMemory : public BaseException { public: - string file_path; - OutOfMemory(string message, string file_path) + std::string file_path; + OutOfMemory(std::string message, std::string file_path) : BaseException(message), file_path(file_path) { } - virtual ~OutOfMemory() throw () {} + virtual ~OutOfMemory() noexcept {} }; /// Exception when a reader is closed, and a frame is requested class ReaderClosed : public BaseException { public: - string file_path; - ReaderClosed(string message, string file_path) + std::string file_path; + ReaderClosed(std::string message, std::string file_path) : BaseException(message), file_path(file_path) { } - virtual ~ReaderClosed() throw () {} + virtual ~ReaderClosed() noexcept {} }; /// Exception when resample fails class ResampleError : public BaseException { public: - string file_path; - ResampleError(string message, string file_path) + std::string file_path; + ResampleError(std::string message, std::string file_path) : BaseException(message), file_path(file_path) { } - virtual ~ResampleError() throw () {} + virtual ~ResampleError() noexcept {} }; /// Exception when too many seek attempts happen class TooManySeeks : public BaseException { public: - string file_path; - TooManySeeks(string message, string file_path) + std::string file_path; + TooManySeeks(std::string message, std::string file_path) : BaseException(message), file_path(file_path) { } - virtual ~TooManySeeks() throw () {} + virtual ~TooManySeeks() noexcept {} }; /// Exception when a writer is closed, and a frame is requested class WriterClosed : public BaseException { public: - string file_path; - WriterClosed(string message, string file_path) + std::string file_path; + WriterClosed(std::string message, std::string file_path) : BaseException(message), file_path(file_path) { } - virtual ~WriterClosed() throw () {} + virtual ~WriterClosed() noexcept {} }; } diff --git a/src/CacheDisk.cpp b/src/CacheDisk.cpp index ee80c21f..b1b1876b 100644 --- a/src/CacheDisk.cpp +++ b/src/CacheDisk.cpp @@ -526,7 +526,7 @@ void CacheDisk::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)", ""); diff --git a/src/CacheMemory.cpp b/src/CacheMemory.cpp index fd1af22f..7bd480e4 100644 --- a/src/CacheMemory.cpp +++ b/src/CacheMemory.cpp @@ -379,7 +379,7 @@ void CacheMemory::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)", ""); diff --git a/src/ChunkReader.cpp b/src/ChunkReader.cpp index 170808e2..9fc8756c 100644 --- a/src/ChunkReader.cpp +++ b/src/ChunkReader.cpp @@ -121,7 +121,7 @@ void ChunkReader::load_json() info.audio_timebase.den = root["audio_timebase"]["den"].asInt(); } - catch (exception e) + catch (const std::exception& e) { // Error parsing JSON (or missing keys) throw InvalidJSON("JSON could not be parsed (or is invalid).", path); @@ -235,7 +235,7 @@ std::shared_ptr ChunkReader::GetFrame(int64_t requested_frame) local_reader = new FFmpegReader(chunk_video_path); local_reader->Open(); // open reader - } catch (InvalidFile) + } catch (const InvalidFile& e) { // Invalid Chunk (possibly it is not found) throw ChunkNotFound(path, requested_frame, location.number, location.frame); @@ -299,7 +299,7 @@ void ChunkReader::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)", ""); diff --git a/src/Clip.cpp b/src/Clip.cpp index 8f72ffb8..3cba8358 100644 --- a/src/Clip.cpp +++ b/src/Clip.cpp @@ -123,7 +123,7 @@ void Clip::init_reader_rotation() { try { float rotate_metadata = strtof(reader->info.metadata["rotate"].c_str(), 0); rotation = Keyframe(rotate_metadata); - } catch (exception e) {} + } catch (const std::exception& e) {} } else // Default no rotation @@ -811,7 +811,7 @@ void Clip::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)", ""); diff --git a/src/Color.cpp b/src/Color.cpp index 0736eb63..b219e695 100644 --- a/src/Color.cpp +++ b/src/Color.cpp @@ -127,7 +127,7 @@ void Color::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)", ""); diff --git a/src/Coordinate.cpp b/src/Coordinate.cpp index a2f40e46..739d693f 100644 --- a/src/Coordinate.cpp +++ b/src/Coordinate.cpp @@ -90,7 +90,7 @@ void Coordinate::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)", ""); diff --git a/src/DecklinkReader.cpp b/src/DecklinkReader.cpp index 21e20b1f..3af5e3fc 100644 --- a/src/DecklinkReader.cpp +++ b/src/DecklinkReader.cpp @@ -285,7 +285,7 @@ void DecklinkReader::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)", ""); diff --git a/src/DummyReader.cpp b/src/DummyReader.cpp index 3c66e9e0..346430dc 100644 --- a/src/DummyReader.cpp +++ b/src/DummyReader.cpp @@ -163,7 +163,7 @@ void DummyReader::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)", ""); diff --git a/src/EffectBase.cpp b/src/EffectBase.cpp index f9f8623b..463a2c2c 100644 --- a/src/EffectBase.cpp +++ b/src/EffectBase.cpp @@ -119,7 +119,7 @@ void EffectBase::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)", ""); diff --git a/src/FFmpegReader.cpp b/src/FFmpegReader.cpp index 40e29e03..16922b93 100644 --- a/src/FFmpegReader.cpp +++ b/src/FFmpegReader.cpp @@ -2441,7 +2441,7 @@ void FFmpegReader::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)", ""); } diff --git a/src/FrameMapper.cpp b/src/FrameMapper.cpp index 8d362381..176be0a1 100644 --- a/src/FrameMapper.cpp +++ b/src/FrameMapper.cpp @@ -714,7 +714,7 @@ void FrameMapper::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)", ""); diff --git a/src/ImageReader.cpp b/src/ImageReader.cpp index bafe76fe..a0b7e8f3 100644 --- a/src/ImageReader.cpp +++ b/src/ImageReader.cpp @@ -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); } @@ -176,7 +176,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)", ""); diff --git a/src/KeyFrame.cpp b/src/KeyFrame.cpp index 5c79fe27..94618135 100644 --- a/src/KeyFrame.cpp +++ b/src/KeyFrame.cpp @@ -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)", ""); diff --git a/src/Point.cpp b/src/Point.cpp index 23b0159a..fd23da55 100644 --- a/src/Point.cpp +++ b/src/Point.cpp @@ -153,7 +153,7 @@ void Point::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)", ""); diff --git a/src/Profiles.cpp b/src/Profiles.cpp index fec06cfa..e57f7aa3 100644 --- a/src/Profiles.cpp +++ b/src/Profiles.cpp @@ -120,7 +120,7 @@ Profile::Profile(string path) { } } - catch (exception e) + catch (const std::exception& e) { // Error parsing profile file throw InvalidFile("Profile could not be found or loaded (or is invalid).", path); @@ -184,7 +184,7 @@ void Profile::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)", ""); diff --git a/src/QtImageReader.cpp b/src/QtImageReader.cpp index a291ac92..9107e51f 100644 --- a/src/QtImageReader.cpp +++ b/src/QtImageReader.cpp @@ -317,7 +317,7 @@ void QtImageReader::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)", ""); diff --git a/src/TextReader.cpp b/src/TextReader.cpp index 9cb75881..27f503e1 100644 --- a/src/TextReader.cpp +++ b/src/TextReader.cpp @@ -237,7 +237,7 @@ void TextReader::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)", ""); diff --git a/src/Timeline.cpp b/src/Timeline.cpp index 16ae2f6c..f8177127 100644 --- a/src/Timeline.cpp +++ b/src/Timeline.cpp @@ -1047,7 +1047,7 @@ void Timeline::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)", ""); @@ -1164,7 +1164,7 @@ void Timeline::ApplyJsonDiff(string value) { } } - 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)", ""); diff --git a/src/WriterBase.cpp b/src/WriterBase.cpp index 729f52e8..f677215a 100644 --- a/src/WriterBase.cpp +++ b/src/WriterBase.cpp @@ -216,7 +216,7 @@ void WriterBase::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)", ""); diff --git a/src/effects/Bars.cpp b/src/effects/Bars.cpp index b85cd454..6d731d9c 100644 --- a/src/effects/Bars.cpp +++ b/src/effects/Bars.cpp @@ -158,7 +158,7 @@ void Bars::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)", ""); diff --git a/src/effects/Blur.cpp b/src/effects/Blur.cpp index f5cad9d9..7946e249 100644 --- a/src/effects/Blur.cpp +++ b/src/effects/Blur.cpp @@ -295,7 +295,7 @@ void Blur::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)", ""); diff --git a/src/effects/Brightness.cpp b/src/effects/Brightness.cpp index c32475b6..3a1a4bdb 100644 --- a/src/effects/Brightness.cpp +++ b/src/effects/Brightness.cpp @@ -149,7 +149,7 @@ void Brightness::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)", ""); diff --git a/src/effects/ChromaKey.cpp b/src/effects/ChromaKey.cpp index 6825eb86..2e2dc511 100644 --- a/src/effects/ChromaKey.cpp +++ b/src/effects/ChromaKey.cpp @@ -142,7 +142,7 @@ void ChromaKey::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)", ""); diff --git a/src/effects/ColorShift.cpp b/src/effects/ColorShift.cpp index 218d47cd..10f22217 100644 --- a/src/effects/ColorShift.cpp +++ b/src/effects/ColorShift.cpp @@ -241,7 +241,7 @@ void ColorShift::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)", ""); diff --git a/src/effects/Crop.cpp b/src/effects/Crop.cpp index 67c61f1e..7ff6ec0b 100644 --- a/src/effects/Crop.cpp +++ b/src/effects/Crop.cpp @@ -157,7 +157,7 @@ void Crop::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)", ""); diff --git a/src/effects/Deinterlace.cpp b/src/effects/Deinterlace.cpp index 6e7f22f3..65f00ff6 100644 --- a/src/effects/Deinterlace.cpp +++ b/src/effects/Deinterlace.cpp @@ -136,7 +136,7 @@ void Deinterlace::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)", ""); diff --git a/src/effects/Hue.cpp b/src/effects/Hue.cpp index 5739e3f4..fd33272d 100644 --- a/src/effects/Hue.cpp +++ b/src/effects/Hue.cpp @@ -143,7 +143,7 @@ void Hue::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)", ""); diff --git a/src/effects/Mask.cpp b/src/effects/Mask.cpp index 9e20b2cb..9f19475d 100644 --- a/src/effects/Mask.cpp +++ b/src/effects/Mask.cpp @@ -196,7 +196,7 @@ void Mask::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)", ""); diff --git a/src/effects/Negate.cpp b/src/effects/Negate.cpp index 8451888f..938030bc 100644 --- a/src/effects/Negate.cpp +++ b/src/effects/Negate.cpp @@ -97,7 +97,7 @@ void Negate::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)", ""); diff --git a/src/effects/Pixelate.cpp b/src/effects/Pixelate.cpp index 19324def..d7c3fa12 100644 --- a/src/effects/Pixelate.cpp +++ b/src/effects/Pixelate.cpp @@ -154,7 +154,7 @@ void Pixelate::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)", ""); diff --git a/src/effects/Saturation.cpp b/src/effects/Saturation.cpp index b101d96a..98818127 100644 --- a/src/effects/Saturation.cpp +++ b/src/effects/Saturation.cpp @@ -154,7 +154,7 @@ void Saturation::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)", ""); diff --git a/src/effects/Shift.cpp b/src/effects/Shift.cpp index d5445add..c22844e7 100644 --- a/src/effects/Shift.cpp +++ b/src/effects/Shift.cpp @@ -174,7 +174,7 @@ void Shift::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)", ""); diff --git a/src/effects/Wave.cpp b/src/effects/Wave.cpp index 6733b7dd..6e3bd48a 100644 --- a/src/effects/Wave.cpp +++ b/src/effects/Wave.cpp @@ -157,7 +157,7 @@ void Wave::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)", ""); diff --git a/tests/Clip_Tests.cpp b/tests/Clip_Tests.cpp index a43b8faa..1b7475f4 100644 --- a/tests/Clip_Tests.cpp +++ b/tests/Clip_Tests.cpp @@ -129,7 +129,7 @@ TEST(Clip_Properties) CHECK_EQUAL(true, root["alpha"]["keyframe"].asBool()); } - 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)", ""); @@ -154,7 +154,7 @@ TEST(Clip_Properties) CHECK_EQUAL(false, root["alpha"]["keyframe"].asBool()); } - 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)", ""); @@ -178,7 +178,7 @@ TEST(Clip_Properties) CHECK_EQUAL(false, root["alpha"]["keyframe"].asBool()); } - 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)", ""); @@ -203,7 +203,7 @@ TEST(Clip_Properties) CHECK_EQUAL(true, root["alpha"]["keyframe"].asBool()); } - 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)", "");