#pragma once

#include <QString>
#include <exception>

constexpr int maxExceptionMessageLength = 256;

/**
 * @brief Base class for all exceptions
 */
class BaseException : public std::exception
{
public:
    explicit BaseException(const std::string& message);
    const char* what() const noexcept override;

protected:
    char message_[maxExceptionMessageLength];
};

/**
 * @brief Used to stop command line applications with error
 */
class LogicException : public BaseException
{
public:
    explicit LogicException(const std::string& message);
};

/**
 * @brief Thrown during loading of file
 */
class FileLoadException : public BaseException
{
public:
    explicit FileLoadException(const std::string& message);
};

/**
 * @brief Thrown during saving of file
 */
class FileSaveException : public BaseException
{
public:
    explicit FileSaveException(const std::string& message);
};

/**
 * @brief Thrown during operations with filesystem
 */
class StorageException : public BaseException
{
public:
    explicit StorageException(const std::string& message);
};
