Initial commit
This commit is contained in:
12
src/Exceptions/DebugServerInterrupted.hpp
Normal file
12
src/Exceptions/DebugServerInterrupted.hpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "Exception.hpp"
|
||||
namespace Bloom::Exceptions
|
||||
{
|
||||
class DebugServerInterrupted: public Exception
|
||||
{
|
||||
public:
|
||||
explicit DebugServerInterrupted() = default;
|
||||
|
||||
};
|
||||
}
|
||||
18
src/Exceptions/DeviceCommunicationFailure.hpp
Normal file
18
src/Exceptions/DeviceCommunicationFailure.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include "Exception.hpp"
|
||||
|
||||
namespace Bloom::Exceptions
|
||||
{
|
||||
class DeviceCommunicationFailure: public Exception
|
||||
{
|
||||
public:
|
||||
explicit DeviceCommunicationFailure(const std::string& message) : Exception(message) {
|
||||
this->message = message;
|
||||
}
|
||||
|
||||
explicit DeviceCommunicationFailure(const char* message) : Exception(message) {
|
||||
this->message = std::string(message);
|
||||
}
|
||||
};
|
||||
}
|
||||
30
src/Exceptions/Exception.hpp
Normal file
30
src/Exceptions/Exception.hpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdexcept>
|
||||
namespace Bloom::Exceptions
|
||||
{
|
||||
class Exception: public std::runtime_error
|
||||
{
|
||||
protected:
|
||||
std::string message;
|
||||
|
||||
public:
|
||||
explicit Exception() : std::runtime_error("") {}
|
||||
|
||||
explicit Exception(const std::string& message) : std::runtime_error(message.c_str()) {
|
||||
this->message = message;
|
||||
}
|
||||
|
||||
explicit Exception(const char* message) : std::runtime_error(message) {
|
||||
this->message = std::string(message);
|
||||
}
|
||||
|
||||
const char* what() const noexcept override {
|
||||
return this->message.c_str();
|
||||
}
|
||||
|
||||
std::string getMessage() const {
|
||||
return this->message;
|
||||
}
|
||||
};
|
||||
}
|
||||
17
src/Exceptions/InvalidConfig.hpp
Normal file
17
src/Exceptions/InvalidConfig.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include "Exception.hpp"
|
||||
namespace Bloom::Exceptions
|
||||
{
|
||||
class InvalidConfig: public Exception
|
||||
{
|
||||
public:
|
||||
explicit InvalidConfig(const std::string& message) : Exception(message) {
|
||||
this->message = message;
|
||||
}
|
||||
|
||||
explicit InvalidConfig(const char* message) : Exception(message) {
|
||||
this->message = std::string(message);
|
||||
}
|
||||
};
|
||||
}
|
||||
17
src/Exceptions/TargetControllerStartupFailure.hpp
Normal file
17
src/Exceptions/TargetControllerStartupFailure.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include "Exception.hpp"
|
||||
namespace Bloom::Exceptions
|
||||
{
|
||||
class TargetControllerStartupFailure: public Exception
|
||||
{
|
||||
public:
|
||||
explicit TargetControllerStartupFailure(const std::string& message) : Exception(message) {
|
||||
this->message = message;
|
||||
}
|
||||
|
||||
explicit TargetControllerStartupFailure(const char* message) : Exception(message) {
|
||||
this->message = std::string(message);
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user