aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnavailableDev <69792062+UnavailableDev@users.noreply.github.com>2024-06-12 13:58:02 +0200
committerUnavailableDev <69792062+UnavailableDev@users.noreply.github.com>2024-06-12 13:58:02 +0200
commit064512cb02465ec598e46ae4bc7947395ed66dc2 (patch)
tree4cae51a55c8b21259447e45e3ca574739c24c890
parentb93c2d642d7c9f94f36f408f3614741b29161c14 (diff)
now trowing error on no probe input
-rw-r--r--NodeOutput.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/NodeOutput.cpp b/NodeOutput.cpp
index d47b6a3..00ca006 100644
--- a/NodeOutput.cpp
+++ b/NodeOutput.cpp
@@ -1,4 +1,6 @@
#include "NodeOutput.h"
+#include "Exception.h"
+
#include <iostream>
NodeOutput NodeOutput::instance(NodeOutput::type);
@@ -6,11 +8,10 @@ NodeOutput NodeOutput::instance(NodeOutput::type);
NodeOutput::NodeOutput(const char * type) : Node(type) { }
void NodeOutput::sim() {
- if (this->inputs.size() > 0) {
- std::cout << this->inputs[0]->getLevel() << "foo" << std::endl;
- } else {
- std::cout << "err: No inputs on probe" << std::endl;
- }
+ if (this->inputs.size() == 0)
+ throw CircuitException("No inputs on probe");
+
+ std::cout << this->inputs[0]->getLevel() << "foo" << std::endl;
}
NodeOutput::NodeOutput(const NodeOutput * prototype) : Node() { }