You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
src: Don't pass "" file_path args to exceptions
This commit is contained in:
@@ -519,7 +519,7 @@ void CacheDisk::SetJson(string value) {
|
||||
|
||||
if (!success)
|
||||
// Raise exception
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)", "");
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -529,7 +529,7 @@ void CacheDisk::SetJson(string value) {
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
// Error parsing JSON (or missing keys)
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -372,7 +372,7 @@ void CacheMemory::SetJson(string value) {
|
||||
delete reader;
|
||||
if (!success)
|
||||
// Raise exception
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)", "");
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -382,7 +382,7 @@ void CacheMemory::SetJson(string value) {
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
// Error parsing JSON (or missing keys)
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -292,7 +292,7 @@ void ChunkReader::SetJson(string value) {
|
||||
delete reader;
|
||||
if (!success)
|
||||
// Raise exception
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)", "");
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -302,7 +302,7 @@ void ChunkReader::SetJson(string value) {
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
// Error parsing JSON (or missing keys)
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
16
src/Clip.cpp
16
src/Clip.cpp
@@ -235,7 +235,7 @@ ReaderBase* Clip::Reader()
|
||||
return reader;
|
||||
else
|
||||
// Throw error if reader not initialized
|
||||
throw ReaderClosed("No Reader has been initialized for this Clip. Call Reader(*reader) before calling this method.", "");
|
||||
throw ReaderClosed("No Reader has been initialized for this Clip. Call Reader(*reader) before calling this method.");
|
||||
}
|
||||
|
||||
// Open the internal reader
|
||||
@@ -252,7 +252,7 @@ void Clip::Open()
|
||||
}
|
||||
else
|
||||
// Throw error if reader not initialized
|
||||
throw ReaderClosed("No Reader has been initialized for this Clip. Call Reader(*reader) before calling this method.", "");
|
||||
throw ReaderClosed("No Reader has been initialized for this Clip. Call Reader(*reader) before calling this method.");
|
||||
}
|
||||
|
||||
// Close the internal reader
|
||||
@@ -266,7 +266,7 @@ void Clip::Close()
|
||||
}
|
||||
else
|
||||
// Throw error if reader not initialized
|
||||
throw ReaderClosed("No Reader has been initialized for this Clip. Call Reader(*reader) before calling this method.", "");
|
||||
throw ReaderClosed("No Reader has been initialized for this Clip. Call Reader(*reader) before calling this method.");
|
||||
}
|
||||
|
||||
// Get end position of clip (trim end of video), which can be affected by the time curve.
|
||||
@@ -282,7 +282,7 @@ float Clip::End()
|
||||
fps = reader->info.fps.ToFloat();
|
||||
else
|
||||
// Throw error if reader not initialized
|
||||
throw ReaderClosed("No Reader has been initialized for this Clip. Call Reader(*reader) before calling this method.", "");
|
||||
throw ReaderClosed("No Reader has been initialized for this Clip. Call Reader(*reader) before calling this method.");
|
||||
|
||||
return float(time.GetLength()) / fps;
|
||||
}
|
||||
@@ -350,7 +350,7 @@ std::shared_ptr<Frame> Clip::GetFrame(int64_t requested_frame)
|
||||
}
|
||||
else
|
||||
// Throw error if reader not initialized
|
||||
throw ReaderClosed("No Reader has been initialized for this Clip. Call Reader(*reader) before calling this method.", "");
|
||||
throw ReaderClosed("No Reader has been initialized for this Clip. Call Reader(*reader) before calling this method.");
|
||||
}
|
||||
|
||||
// Get file extension
|
||||
@@ -394,7 +394,7 @@ void Clip::get_time_mapped_frame(std::shared_ptr<Frame> frame, int64_t frame_num
|
||||
// Check for valid reader
|
||||
if (!reader)
|
||||
// Throw error if reader not initialized
|
||||
throw ReaderClosed("No Reader has been initialized for this Clip. Call Reader(*reader) before calling this method.", "");
|
||||
throw ReaderClosed("No Reader has been initialized for this Clip. Call Reader(*reader) before calling this method.");
|
||||
|
||||
// Check for a valid time map curve
|
||||
if (time.Values.size() > 1)
|
||||
@@ -812,7 +812,7 @@ void Clip::SetJson(string value) {
|
||||
|
||||
if (!success)
|
||||
// Raise exception
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)", "");
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -822,7 +822,7 @@ void Clip::SetJson(string value) {
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
// Error parsing JSON (or missing keys)
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ void Color::SetJson(string value) {
|
||||
|
||||
if (!success)
|
||||
// Raise exception
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)", "");
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -130,7 +130,7 @@ void Color::SetJson(string value) {
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
// Error parsing JSON (or missing keys)
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ void Coordinate::SetJson(string value) {
|
||||
|
||||
if (!success)
|
||||
// Raise exception
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)", "");
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -93,7 +93,7 @@ void Coordinate::SetJson(string value) {
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
// Error parsing JSON (or missing keys)
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -278,7 +278,7 @@ void DecklinkReader::SetJson(string value) {
|
||||
|
||||
if (!success)
|
||||
// Raise exception
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)", "");
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -288,7 +288,7 @@ void DecklinkReader::SetJson(string value) {
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
// Error parsing JSON (or missing keys)
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -234,7 +234,7 @@ void DecklinkWriter::WriteFrame(std::shared_ptr<Frame> frame)
|
||||
{
|
||||
// Check for open reader (or throw exception)
|
||||
if (!is_open)
|
||||
throw WriterClosed("The DecklinkWriter is closed. Call Open() before calling this method.", "");
|
||||
throw WriterClosed("The DecklinkWriter is closed. Call Open() before calling this method.");
|
||||
|
||||
delegate->WriteFrame(frame);
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ void DummyReader::SetJson(string value) {
|
||||
|
||||
if (!success)
|
||||
// Raise exception
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)", "");
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -166,7 +166,7 @@ void DummyReader::SetJson(string value) {
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
// Error parsing JSON (or missing keys)
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ void EffectBase::SetJson(string value) {
|
||||
|
||||
if (!success)
|
||||
// Raise exception
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)", "");
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -122,7 +122,7 @@ void EffectBase::SetJson(string value) {
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
// Error parsing JSON (or missing keys)
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2445,7 +2445,7 @@ void FFmpegReader::SetJson(string value) {
|
||||
|
||||
if (!success)
|
||||
// Raise exception
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)", "");
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)");
|
||||
|
||||
try {
|
||||
// Set all values that match
|
||||
@@ -2453,7 +2453,7 @@ void FFmpegReader::SetJson(string value) {
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
// Error parsing JSON (or missing keys)
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ ReaderBase* FrameMapper::Reader()
|
||||
return reader;
|
||||
else
|
||||
// Throw error if reader not initialized
|
||||
throw ReaderClosed("No Reader has been initialized for FrameMapper. Call Reader(*reader) before calling this method.", "");
|
||||
throw ReaderClosed("No Reader has been initialized for FrameMapper. Call Reader(*reader) before calling this method.");
|
||||
}
|
||||
|
||||
void FrameMapper::AddField(int64_t frame)
|
||||
@@ -707,7 +707,7 @@ void FrameMapper::SetJson(string value) {
|
||||
|
||||
if (!success)
|
||||
// Raise exception
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)", "");
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -717,7 +717,7 @@ void FrameMapper::SetJson(string value) {
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
// Error parsing JSON (or missing keys)
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ void ImageReader::SetJson(string value) {
|
||||
|
||||
if (!success)
|
||||
// Raise exception
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)", "");
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -179,7 +179,7 @@ void ImageReader::SetJson(string value) {
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
// Error parsing JSON (or missing keys)
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -379,7 +379,7 @@ void Keyframe::SetJson(string value) {
|
||||
|
||||
if (!success)
|
||||
// Raise exception
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)", "");
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -389,7 +389,7 @@ void Keyframe::SetJson(string value) {
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
// Error parsing JSON (or missing keys)
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ void Point::SetJson(string value) {
|
||||
|
||||
if (!success)
|
||||
// Raise exception
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)", "");
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -156,7 +156,7 @@ void Point::SetJson(string value) {
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
// Error parsing JSON (or missing keys)
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ void Profile::SetJson(string value) {
|
||||
|
||||
if (!success)
|
||||
// Raise exception
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)", "");
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -187,7 +187,7 @@ void Profile::SetJson(string value) {
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
// Error parsing JSON (or missing keys)
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -310,7 +310,7 @@ void QtImageReader::SetJson(string value) {
|
||||
|
||||
if (!success)
|
||||
// Raise exception
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)", "");
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -320,7 +320,7 @@ void QtImageReader::SetJson(string value) {
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
// Error parsing JSON (or missing keys)
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ void TextReader::SetJson(string value) {
|
||||
|
||||
if (!success)
|
||||
// Raise exception
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)", "");
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -240,7 +240,7 @@ void TextReader::SetJson(string value) {
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
// Error parsing JSON (or missing keys)
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -746,7 +746,7 @@ std::shared_ptr<Frame> Timeline::GetFrame(int64_t requested_frame)
|
||||
|
||||
// Check for open reader (or throw exception)
|
||||
if (!is_open)
|
||||
throw ReaderClosed("The Timeline is closed. Call Open() before calling this method.", "");
|
||||
throw ReaderClosed("The Timeline is closed. Call Open() before calling this method.");
|
||||
|
||||
// Check cache again (due to locking)
|
||||
#pragma omp critical (T_GetFrame)
|
||||
@@ -1040,7 +1040,7 @@ void Timeline::SetJson(string value) {
|
||||
|
||||
if (!success)
|
||||
// Raise exception
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)", "");
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -1050,7 +1050,7 @@ void Timeline::SetJson(string value) {
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
// Error parsing JSON (or missing keys)
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1139,7 +1139,7 @@ void Timeline::ApplyJsonDiff(string value) {
|
||||
|
||||
if (!success || !root.isArray())
|
||||
// Raise exception
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid).", "");
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid).");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -1167,7 +1167,7 @@ void Timeline::ApplyJsonDiff(string value) {
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
// Error parsing JSON (or missing keys)
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ void WriterBase::SetJson(string value) {
|
||||
|
||||
if (!success)
|
||||
// Raise exception
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)", "");
|
||||
throw InvalidJSON("JSON could not be parsed (or is invalid)");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -219,7 +219,7 @@ void WriterBase::SetJson(string value) {
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
// Error parsing JSON (or missing keys)
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)", "");
|
||||
throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user