Check if Microchip hybrid devices (Snap and PICkit 4) are not in AVR mode and report back to the user.

This commit is contained in:
Nav
2023-05-07 16:44:15 +01:00
parent 7bdc03116e
commit adcca0079d
7 changed files with 99 additions and 12 deletions

View File

@@ -0,0 +1,18 @@
#pragma once
#include "src/Exceptions/Exception.hpp"
namespace Bloom::Exceptions
{
class DeviceNotFound: public Exception
{
public:
explicit DeviceNotFound(const std::string& message): Exception(message) {
this->message = message;
}
explicit DeviceNotFound(const char* message): Exception(message) {
this->message = std::string(message);
}
};
}

View File

@@ -9,9 +9,6 @@
#include "src/Services/ProcessService.hpp"
#include "src/Logger/Logger.hpp"
#include "src/TargetController/Exceptions/DeviceFailure.hpp"
#include "src/TargetController/Exceptions/TargetOperationFailure.hpp"
#include "src/Exceptions/TargetControllerStartupFailure.hpp"
#include "src/Exceptions/InvalidConfig.hpp"
namespace Bloom::TargetController
@@ -97,14 +94,6 @@ namespace Bloom::TargetController
}
}
} catch (const TargetControllerStartupFailure& exception) {
Logger::error("TargetController failed to start up. See below for errors:");
Logger::error(exception.getMessage());
} catch (const Exception& exception) {
Logger::error("The TargetController encountered a fatal error. See below for errors:");
Logger::error(exception.getMessage());
} catch (const std::exception& exception) {
Logger::error("The TargetController encountered a fatal error. See below for errors:");
Logger::error(std::string(exception.what()));