2011-10-11 08:44:27 -05:00
|
|
|
/**
|
2013-09-09 23:32:16 -05:00
|
|
|
* @file
|
|
|
|
|
* @brief Header file for all Exception classes
|
2013-09-12 17:52:10 -05:00
|
|
|
* @author Jonathan Thomas <jonathan@openshot.org>
|
|
|
|
|
*
|
2019-06-09 08:31:04 -04:00
|
|
|
* @ref License
|
|
|
|
|
*/
|
|
|
|
|
|
2021-10-16 01:26:26 -04:00
|
|
|
// Copyright (c) 2008-2019 OpenShot Studios, LLC
|
|
|
|
|
//
|
|
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
2011-10-11 08:44:27 -05:00
|
|
|
|
2013-09-12 17:52:10 -05:00
|
|
|
#ifndef OPENSHOT_EXCEPTIONS_H
|
|
|
|
|
#define OPENSHOT_EXCEPTIONS_H
|
|
|
|
|
|
2013-12-06 00:40:26 -06:00
|
|
|
#include <string>
|
2021-07-12 22:47:43 -04:00
|
|
|
#include <cstring>
|
2011-10-11 08:44:27 -05:00
|
|
|
|
|
|
|
|
namespace openshot {
|
|
|
|
|
|
|
|
|
|
/**
|
2013-09-09 23:32:16 -05:00
|
|
|
* @brief Base exception class with a custom message variable.
|
2011-10-11 08:44:27 -05:00
|
|
|
*
|
2020-04-22 02:01:01 -04:00
|
|
|
* A std::exception-derived exception class with custom message.
|
|
|
|
|
* All OpenShot exception classes inherit from this class.
|
2011-10-11 08:44:27 -05:00
|
|
|
*/
|
2021-03-07 11:23:59 -05:00
|
|
|
class ExceptionBase : public std::exception
|
2011-10-11 08:44:27 -05:00
|
|
|
{
|
|
|
|
|
protected:
|
2019-07-03 13:12:02 -04:00
|
|
|
std::string m_message;
|
2011-10-11 08:44:27 -05:00
|
|
|
public:
|
2020-04-22 02:01:01 -04:00
|
|
|
ExceptionBase(std::string message) : m_message(message) { }
|
|
|
|
|
virtual ~ExceptionBase() noexcept {}
|
2019-07-03 13:12:02 -04:00
|
|
|
virtual const char* what() const noexcept {
|
2011-10-11 08:44:27 -05:00
|
|
|
// return custom message
|
|
|
|
|
return m_message.c_str();
|
|
|
|
|
}
|
2021-07-12 22:47:43 -04:00
|
|
|
virtual std::string py_message() const {
|
|
|
|
|
// return complete message for Python exception handling
|
|
|
|
|
return m_message;
|
|
|
|
|
}
|
2011-10-11 08:44:27 -05:00
|
|
|
};
|
|
|
|
|
|
2021-07-12 22:47:43 -04:00
|
|
|
class FrameExceptionBase : public ExceptionBase
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
int64_t frame_number;
|
|
|
|
|
FrameExceptionBase(std::string message, int64_t frame_number=-1)
|
|
|
|
|
: ExceptionBase(message), frame_number(frame_number) { }
|
|
|
|
|
virtual std::string py_message() const override {
|
|
|
|
|
// return complete message for Python exception handling
|
|
|
|
|
std::string out_msg(m_message +
|
|
|
|
|
(frame_number > 0
|
|
|
|
|
? " at frame " + std::to_string(frame_number)
|
|
|
|
|
: ""));
|
|
|
|
|
return out_msg;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FileExceptionBase : public ExceptionBase
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
std::string file_path;
|
|
|
|
|
FileExceptionBase(std::string message, std::string file_path="")
|
|
|
|
|
: ExceptionBase(message), file_path(file_path) { }
|
|
|
|
|
virtual std::string py_message() const override {
|
|
|
|
|
// return complete message for Python exception handling
|
|
|
|
|
std::string out_msg(m_message +
|
|
|
|
|
(file_path != ""
|
|
|
|
|
? " for file " + file_path
|
|
|
|
|
: ""));
|
|
|
|
|
return out_msg;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2013-08-28 15:28:19 -05:00
|
|
|
/// Exception when a required chunk is missing
|
2021-07-12 22:47:43 -04:00
|
|
|
class ChunkNotFound : public FrameExceptionBase
|
2013-08-28 15:28:19 -05:00
|
|
|
{
|
|
|
|
|
public:
|
2017-09-28 16:03:01 -05:00
|
|
|
int64_t chunk_number;
|
|
|
|
|
int64_t chunk_frame;
|
2019-08-27 20:48:56 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param message A message to accompany the exception
|
|
|
|
|
* @param frame_number The frame number being processed
|
|
|
|
|
* @param chunk_number The chunk requested
|
|
|
|
|
* @param chunk_frame The chunk frame
|
|
|
|
|
*/
|
2019-07-03 13:12:02 -04:00
|
|
|
ChunkNotFound(std::string message, int64_t frame_number, int64_t chunk_number, int64_t chunk_frame)
|
2021-07-12 22:47:43 -04:00
|
|
|
: FrameExceptionBase(message, frame_number), chunk_number(chunk_number), chunk_frame(chunk_frame) { }
|
2019-07-03 13:12:02 -04:00
|
|
|
virtual ~ChunkNotFound() noexcept {}
|
2013-08-28 15:28:19 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2013-02-09 01:54:40 -06:00
|
|
|
/// Exception when accessing a blackmagic decklink card
|
2020-04-22 02:01:01 -04:00
|
|
|
class DecklinkError : public ExceptionBase
|
2013-02-09 01:54:40 -06:00
|
|
|
{
|
|
|
|
|
public:
|
2019-08-27 20:48:56 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param message A message to accompany the exception
|
|
|
|
|
*/
|
2019-07-03 13:12:02 -04:00
|
|
|
DecklinkError(std::string message)
|
2020-04-22 02:01:01 -04:00
|
|
|
: ExceptionBase(message) { }
|
2019-07-03 13:12:02 -04:00
|
|
|
virtual ~DecklinkError() noexcept {}
|
2013-02-09 01:54:40 -06:00
|
|
|
};
|
|
|
|
|
|
2012-07-20 00:13:16 -05:00
|
|
|
/// Exception when decoding audio packet
|
2021-07-12 22:47:43 -04:00
|
|
|
class ErrorDecodingAudio : public FrameExceptionBase
|
2012-07-20 00:13:16 -05:00
|
|
|
{
|
|
|
|
|
public:
|
2019-08-27 20:48:56 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param message A message to accompany the exception
|
|
|
|
|
* @param frame_number The frame number being processed
|
|
|
|
|
*/
|
2021-07-12 22:47:43 -04:00
|
|
|
ErrorDecodingAudio(std::string message, int64_t frame_number=-1)
|
|
|
|
|
: FrameExceptionBase(message, frame_number) { }
|
2019-07-03 13:12:02 -04:00
|
|
|
virtual ~ErrorDecodingAudio() noexcept {}
|
2012-07-20 00:13:16 -05:00
|
|
|
};
|
|
|
|
|
|
2012-07-24 12:50:17 -05:00
|
|
|
/// Exception when encoding audio packet
|
2021-07-12 22:47:43 -04:00
|
|
|
class ErrorEncodingAudio : public FrameExceptionBase
|
2012-07-24 12:50:17 -05:00
|
|
|
{
|
|
|
|
|
public:
|
2019-08-27 20:48:56 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param message A message to accompany the exception
|
|
|
|
|
* @param frame_number The frame number being processed
|
|
|
|
|
*/
|
2021-07-12 22:47:43 -04:00
|
|
|
ErrorEncodingAudio(std::string message, int64_t frame_number=-1)
|
|
|
|
|
: FrameExceptionBase(message, frame_number) { }
|
2019-07-03 13:12:02 -04:00
|
|
|
virtual ~ErrorEncodingAudio() noexcept {}
|
2012-07-24 12:50:17 -05:00
|
|
|
};
|
|
|
|
|
|
2012-08-04 01:11:12 -05:00
|
|
|
/// Exception when encoding audio packet
|
2021-07-12 22:47:43 -04:00
|
|
|
class ErrorEncodingVideo : public FrameExceptionBase
|
2012-08-04 01:11:12 -05:00
|
|
|
{
|
|
|
|
|
public:
|
2019-08-27 20:48:56 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param message A message to accompany the exception
|
|
|
|
|
* @param frame_number The frame number being processed
|
|
|
|
|
*/
|
2021-07-12 22:47:43 -04:00
|
|
|
ErrorEncodingVideo(std::string message, int64_t frame_number=-1)
|
|
|
|
|
: FrameExceptionBase(message, frame_number) { }
|
2019-07-03 13:12:02 -04:00
|
|
|
virtual ~ErrorEncodingVideo() noexcept {}
|
2012-08-04 01:11:12 -05:00
|
|
|
};
|
|
|
|
|
|
2012-07-27 17:44:18 -05:00
|
|
|
/// Exception when an invalid # of audio channels are detected
|
2021-07-12 22:47:43 -04:00
|
|
|
class InvalidChannels : public FileExceptionBase
|
2012-07-27 17:44:18 -05:00
|
|
|
{
|
|
|
|
|
public:
|
2019-08-27 20:48:56 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param message A message to accompany the exception
|
|
|
|
|
* @param file_path (optional) The input file being processed
|
|
|
|
|
*/
|
2019-08-27 15:46:31 -04:00
|
|
|
InvalidChannels(std::string message, std::string file_path="")
|
2021-07-12 22:47:43 -04:00
|
|
|
: FileExceptionBase(message, file_path) { }
|
2019-07-03 13:12:02 -04:00
|
|
|
virtual ~InvalidChannels() noexcept {}
|
2012-07-27 17:44:18 -05:00
|
|
|
};
|
|
|
|
|
|
2012-07-20 00:13:16 -05:00
|
|
|
/// Exception when no valid codec is found for a file
|
2021-07-12 22:47:43 -04:00
|
|
|
class InvalidCodec : public FileExceptionBase
|
2012-07-20 00:13:16 -05:00
|
|
|
{
|
|
|
|
|
public:
|
2019-08-27 20:48:56 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param message A message to accompany the exception
|
|
|
|
|
* @param file_path (optional) The input file being processed
|
|
|
|
|
*/
|
2019-08-27 15:46:31 -04:00
|
|
|
InvalidCodec(std::string message, std::string file_path="")
|
2021-07-12 22:47:43 -04:00
|
|
|
: FileExceptionBase(message, file_path) { }
|
2019-07-03 13:12:02 -04:00
|
|
|
virtual ~InvalidCodec() noexcept {}
|
2012-07-20 00:13:16 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/// Exception for files that can not be found or opened
|
2021-07-12 22:47:43 -04:00
|
|
|
class InvalidFile : public FileExceptionBase
|
2012-07-20 00:13:16 -05:00
|
|
|
{
|
|
|
|
|
public:
|
2019-08-27 20:48:56 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param message A message to accompany the exception
|
|
|
|
|
* @param file_path The input file being processed
|
|
|
|
|
*/
|
2019-07-03 13:12:02 -04:00
|
|
|
InvalidFile(std::string message, std::string file_path)
|
2021-07-12 22:47:43 -04:00
|
|
|
: FileExceptionBase(message, file_path) { }
|
2019-07-03 13:12:02 -04:00
|
|
|
virtual ~InvalidFile() noexcept {}
|
2012-07-20 00:13:16 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/// Exception when no valid format is found for a file
|
2021-07-12 22:47:43 -04:00
|
|
|
class InvalidFormat : public FileExceptionBase
|
2012-07-20 00:13:16 -05:00
|
|
|
{
|
|
|
|
|
public:
|
2019-08-27 20:48:56 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param message A message to accompany the exception
|
|
|
|
|
* @param file_path (optional) The input file being processed
|
|
|
|
|
*/
|
2019-08-27 15:46:31 -04:00
|
|
|
InvalidFormat(std::string message, std::string file_path="")
|
2021-07-12 22:47:43 -04:00
|
|
|
: FileExceptionBase(message, file_path) { }
|
2019-07-03 13:12:02 -04:00
|
|
|
virtual ~InvalidFormat() noexcept {}
|
2012-07-20 00:13:16 -05:00
|
|
|
};
|
|
|
|
|
|
2013-08-28 13:51:22 -05:00
|
|
|
/// Exception for invalid JSON
|
2021-07-12 22:47:43 -04:00
|
|
|
class InvalidJSON : public FileExceptionBase
|
2013-08-28 13:51:22 -05:00
|
|
|
{
|
|
|
|
|
public:
|
2019-08-27 20:48:56 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param message A message to accompany the exception
|
|
|
|
|
* @param file_path (optional) The input file being processed
|
|
|
|
|
*/
|
2019-08-27 15:46:31 -04:00
|
|
|
InvalidJSON(std::string message, std::string file_path="")
|
2021-07-12 22:47:43 -04:00
|
|
|
: FileExceptionBase(message, file_path) { }
|
2019-07-03 13:12:02 -04:00
|
|
|
virtual ~InvalidJSON() noexcept {}
|
2013-08-28 13:51:22 -05:00
|
|
|
};
|
|
|
|
|
|
2012-07-20 00:13:16 -05:00
|
|
|
/// Exception when invalid encoding options are used
|
2021-07-12 22:47:43 -04:00
|
|
|
class InvalidOptions : public FileExceptionBase
|
2012-07-20 00:13:16 -05:00
|
|
|
{
|
|
|
|
|
public:
|
2019-08-27 20:48:56 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param message A message to accompany the exception
|
|
|
|
|
* @param file_path (optional) The input file being processed
|
|
|
|
|
*/
|
2019-08-27 15:46:31 -04:00
|
|
|
InvalidOptions(std::string message, std::string file_path="")
|
2021-07-12 22:47:43 -04:00
|
|
|
: FileExceptionBase(message, file_path) { }
|
2019-07-03 13:12:02 -04:00
|
|
|
virtual ~InvalidOptions() noexcept {}
|
2012-07-20 00:13:16 -05:00
|
|
|
};
|
|
|
|
|
|
2012-07-27 17:44:18 -05:00
|
|
|
/// Exception when invalid sample rate is detected during encoding
|
2021-07-12 22:47:43 -04:00
|
|
|
class InvalidSampleRate : public FileExceptionBase
|
2012-07-27 17:44:18 -05:00
|
|
|
{
|
|
|
|
|
public:
|
2019-08-27 20:48:56 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param message A message to accompany the exception
|
|
|
|
|
* @param file_path (optional) The input file being processed
|
|
|
|
|
*/
|
2019-08-27 15:46:31 -04:00
|
|
|
InvalidSampleRate(std::string message, std::string file_path="")
|
2021-07-12 22:47:43 -04:00
|
|
|
: FileExceptionBase(message, file_path) { }
|
2019-07-03 13:12:02 -04:00
|
|
|
virtual ~InvalidSampleRate() noexcept {}
|
2012-07-27 17:44:18 -05:00
|
|
|
};
|
|
|
|
|
|
2014-01-08 01:43:58 -06:00
|
|
|
/// Exception for missing JSON Change key
|
2020-04-22 02:01:01 -04:00
|
|
|
class InvalidJSONKey : public ExceptionBase
|
2014-01-08 01:43:58 -06:00
|
|
|
{
|
|
|
|
|
public:
|
2019-07-03 13:12:02 -04:00
|
|
|
std::string json;
|
2019-08-27 20:48:56 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param message A message to accompany the exception
|
|
|
|
|
* @param json The json data being processed
|
|
|
|
|
*/
|
2019-07-03 13:12:02 -04:00
|
|
|
InvalidJSONKey(std::string message, std::string json)
|
2020-04-22 02:01:01 -04:00
|
|
|
: ExceptionBase(message), json(json) { }
|
2019-07-03 13:12:02 -04:00
|
|
|
virtual ~InvalidJSONKey() noexcept {}
|
2021-07-12 22:47:43 -04:00
|
|
|
std::string py_message() const override {
|
|
|
|
|
std::string out_msg = m_message +
|
|
|
|
|
" for JSON data " +
|
|
|
|
|
(json.size() > 100 ? " (abbreviated): " : ": ")
|
|
|
|
|
+ json.substr(0, 99);
|
|
|
|
|
return out_msg;
|
|
|
|
|
}
|
2014-01-08 01:43:58 -06:00
|
|
|
};
|
|
|
|
|
|
2012-07-20 00:13:16 -05:00
|
|
|
/// Exception when no streams are found in the file
|
2021-07-12 22:47:43 -04:00
|
|
|
class NoStreamsFound : public FileExceptionBase
|
2012-07-20 00:13:16 -05:00
|
|
|
{
|
|
|
|
|
public:
|
2019-08-27 20:48:56 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param message A message to accompany the exception
|
|
|
|
|
* @param file_path (optional) The input file being processed
|
|
|
|
|
*/
|
2019-08-27 15:46:31 -04:00
|
|
|
NoStreamsFound(std::string message, std::string file_path="")
|
2021-07-12 22:47:43 -04:00
|
|
|
: FileExceptionBase(message, file_path) { }
|
2019-07-03 13:12:02 -04:00
|
|
|
virtual ~NoStreamsFound() noexcept {}
|
2012-07-20 00:13:16 -05:00
|
|
|
};
|
|
|
|
|
|
2011-10-11 08:44:27 -05:00
|
|
|
/// Exception for frames that are out of bounds.
|
2020-04-22 02:01:01 -04:00
|
|
|
class OutOfBoundsFrame : public ExceptionBase
|
2011-10-11 08:44:27 -05:00
|
|
|
{
|
|
|
|
|
public:
|
2017-09-28 16:03:01 -05:00
|
|
|
int64_t FrameRequested;
|
|
|
|
|
int64_t MaxFrames;
|
2019-08-27 20:48:56 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param message A message to accompany the exception
|
|
|
|
|
* @param frame_requested The out-of-bounds frame number requested
|
|
|
|
|
* @param max_frames The maximum available frame number
|
|
|
|
|
*/
|
2019-07-03 13:12:02 -04:00
|
|
|
OutOfBoundsFrame(std::string message, int64_t frame_requested, int64_t max_frames)
|
2020-04-22 02:01:01 -04:00
|
|
|
: ExceptionBase(message), FrameRequested(frame_requested), MaxFrames(max_frames) { }
|
2019-07-03 13:12:02 -04:00
|
|
|
virtual ~OutOfBoundsFrame() noexcept {}
|
2021-07-12 22:47:43 -04:00
|
|
|
std::string py_message() const override {
|
|
|
|
|
std::string out_msg(m_message
|
|
|
|
|
+ " Frame requested: " + std::to_string(FrameRequested)
|
|
|
|
|
+ " Max frames: " + std::to_string(MaxFrames));
|
|
|
|
|
return out_msg;
|
|
|
|
|
}
|
2011-10-11 08:44:27 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/// Exception for an out of bounds key-frame point.
|
2020-04-22 02:01:01 -04:00
|
|
|
class OutOfBoundsPoint : public ExceptionBase
|
2011-10-11 08:44:27 -05:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
int PointRequested;
|
|
|
|
|
int MaxPoints;
|
2019-08-27 20:48:56 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param message A message to accompany the exception
|
|
|
|
|
* @param point_requested The out-of-bounds point requested
|
|
|
|
|
* @param max_points The maximum available point value
|
|
|
|
|
*/
|
2019-07-03 13:12:02 -04:00
|
|
|
OutOfBoundsPoint(std::string message, int point_requested, int max_points)
|
2020-04-22 02:01:01 -04:00
|
|
|
: ExceptionBase(message), PointRequested(point_requested), MaxPoints(max_points) { }
|
2019-07-03 13:12:02 -04:00
|
|
|
virtual ~OutOfBoundsPoint() noexcept {}
|
2021-07-12 22:47:43 -04:00
|
|
|
std::string py_message() const override {
|
|
|
|
|
std::string out_msg(m_message
|
|
|
|
|
+ " Point requested: " + std::to_string(PointRequested)
|
|
|
|
|
+ " Max point: " + std::to_string(MaxPoints));
|
|
|
|
|
return out_msg;
|
|
|
|
|
}
|
2011-10-11 08:44:27 -05:00
|
|
|
};
|
|
|
|
|
|
2012-07-20 00:13:16 -05:00
|
|
|
/// Exception when memory could not be allocated
|
2021-07-12 22:47:43 -04:00
|
|
|
class OutOfMemory : public FileExceptionBase
|
2011-10-11 08:44:27 -05:00
|
|
|
{
|
|
|
|
|
public:
|
2019-08-27 20:48:56 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param message A message to accompany the exception
|
|
|
|
|
* @param file_path (optional) The input file being processed
|
|
|
|
|
*/
|
2019-08-27 15:46:31 -04:00
|
|
|
OutOfMemory(std::string message, std::string file_path="")
|
2021-07-12 22:47:43 -04:00
|
|
|
: FileExceptionBase(message, file_path) { }
|
2019-07-03 13:12:02 -04:00
|
|
|
virtual ~OutOfMemory() noexcept {}
|
2011-10-11 08:44:27 -05:00
|
|
|
};
|
|
|
|
|
|
2012-10-09 01:45:34 -05:00
|
|
|
/// Exception when a reader is closed, and a frame is requested
|
2021-07-12 22:47:43 -04:00
|
|
|
class ReaderClosed : public FileExceptionBase
|
2012-10-09 01:45:34 -05:00
|
|
|
{
|
|
|
|
|
public:
|
2019-08-27 20:48:56 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param message A message to accompany the exception
|
|
|
|
|
* @param file_path (optional) The input file being processed
|
|
|
|
|
*/
|
2019-08-27 15:46:31 -04:00
|
|
|
ReaderClosed(std::string message, std::string file_path="")
|
2021-07-12 22:47:43 -04:00
|
|
|
: FileExceptionBase(message, file_path) { }
|
2019-07-03 13:12:02 -04:00
|
|
|
virtual ~ReaderClosed() noexcept {}
|
2012-10-09 01:45:34 -05:00
|
|
|
};
|
|
|
|
|
|
2012-08-04 01:11:12 -05:00
|
|
|
/// Exception when resample fails
|
2021-07-12 22:47:43 -04:00
|
|
|
class ResampleError : public FileExceptionBase
|
2012-08-04 01:11:12 -05:00
|
|
|
{
|
|
|
|
|
public:
|
2019-08-27 20:48:56 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param message A message to accompany the exception
|
|
|
|
|
* @param file_path (optional) The input file being processed
|
|
|
|
|
*/
|
2019-08-27 15:46:31 -04:00
|
|
|
ResampleError(std::string message, std::string file_path="")
|
2021-07-12 22:47:43 -04:00
|
|
|
: FileExceptionBase(message, file_path) { }
|
2019-07-03 13:12:02 -04:00
|
|
|
virtual ~ResampleError() noexcept {}
|
2012-08-04 01:11:12 -05:00
|
|
|
};
|
|
|
|
|
|
2021-01-02 15:28:50 -05:00
|
|
|
#define TMS_DEP_MSG "The library no longer throws this exception. It will be removed in a future release."
|
|
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
|
/// Exception when too many seek attempts happen
|
|
|
|
|
class
|
2021-11-11 07:04:26 -05:00
|
|
|
[[deprecated(TMS_DEP_MSG)]]
|
2021-07-12 22:47:43 -04:00
|
|
|
TooManySeeks : public FileExceptionBase
|
2021-01-02 15:28:50 -05:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param message A message to accompany the exception
|
|
|
|
|
* @param file_path (optional) The input file being processed
|
|
|
|
|
*/
|
2021-11-11 07:04:26 -05:00
|
|
|
[[deprecated(TMS_DEP_MSG)]]
|
|
|
|
|
TooManySeeks(std::string message, std::string file_path="")
|
|
|
|
|
: FileExceptionBase(message, file_path) { }
|
2021-01-02 15:28:50 -05:00
|
|
|
virtual ~TooManySeeks() noexcept {}
|
|
|
|
|
};
|
|
|
|
|
#endif
|
|
|
|
|
|
2015-02-05 00:11:55 -06:00
|
|
|
/// Exception when a writer is closed, and a frame is requested
|
2021-07-12 22:47:43 -04:00
|
|
|
class WriterClosed : public FileExceptionBase
|
2015-02-05 00:11:55 -06:00
|
|
|
{
|
|
|
|
|
public:
|
2019-08-27 20:48:56 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param message A message to accompany the exception
|
|
|
|
|
* @param file_path (optional) The output file being written
|
|
|
|
|
*/
|
2019-08-27 15:46:31 -04:00
|
|
|
WriterClosed(std::string message, std::string file_path="")
|
2021-07-12 22:47:43 -04:00
|
|
|
: FileExceptionBase(message, file_path) { }
|
2019-07-03 13:12:02 -04:00
|
|
|
virtual ~WriterClosed() noexcept {}
|
2015-02-05 00:11:55 -06:00
|
|
|
};
|
2011-10-11 08:44:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|