From 064512cb02465ec598e46ae4bc7947395ed66dc2 Mon Sep 17 00:00:00 2001 From: UnavailableDev <69792062+UnavailableDev@users.noreply.github.com> Date: Wed, 12 Jun 2024 13:58:02 +0200 Subject: now trowing error on no probe input --- NodeOutput.cpp | 11 ++++++----- 1 file 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 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() { } -- cgit v1.2.3