From d40a9ed04631d122409a3d2f8a4c3884ae834a35 Mon Sep 17 00:00:00 2001 From: Chris Frey Date: Tue, 8 Feb 2011 18:37:42 -0500 Subject: [PATCH] lib: added new exception: PinNotFound --- doc/Exceptions | 1 + src/error.h | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/doc/Exceptions b/doc/Exceptions index 0342a2ca..80db1890 100644 --- a/doc/Exceptions +++ b/doc/Exceptions @@ -19,6 +19,7 @@ The Barry library has the following exception hierarchy: - Barry::RestoreError - Barry::JDWP::Error - Barry::JDWP::Timeout + - Barry::PinNotFound Usb::Error All specific USB error exceptions will be derived from diff --git a/src/error.h b/src/error.h index 422dfae7..6ca4f629 100644 --- a/src/error.h +++ b/src/error.h @@ -23,6 +23,7 @@ #define __BARRY_ERROR_H__ #include "dll.h" +#include "pin.h" #include #include @@ -75,6 +76,30 @@ public: }; // +// PinNotFound +// +/// Thrown by the Connector class when unable to find the requested Pin +/// If the attached pin is not Valid(), then unable to autodetect device. +/// If pin is Valid(), then the specified pin number was not available. +/// probe_count is the number of devices found during the probe. +/// +class BXEXPORT PinNotFound : public Barry::Error +{ + Barry::Pin m_pin; + int m_probe_count; + +public: + PinNotFound(Barry::Pin pin, int probe_count) + : Barry::Error("PIN not found: " + pin.Str()) + , m_pin(pin) + , m_probe_count(probe_count) + {} + + const Barry::Pin& pin() const { return m_pin; } + int probe_count() const { return m_probe_count; } +}; + +// // BadData // /// Thrown by record classes if their data is invalid and cannot be -- 2.11.4.GIT