From 543f8390edcab0201a68fabe86803b0d6f63ee34 Mon Sep 17 00:00:00 2001 From: Julien Olivain Date: Tue, 13 Dec 2011 14:05:55 -0800 Subject: runtime: improve hier_block2 error messages --- gnuradio-core/src/lib/runtime/gr_hier_block2_detail.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'gnuradio-core/src') diff --git a/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.cc b/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.cc index 877e240c2..1d0c66fb8 100644 --- a/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.cc +++ b/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.cc @@ -318,13 +318,14 @@ gr_hier_block2_detail::resolve_port(int port, bool is_input) if (is_input) { if (port < 0 || port >= (signed)d_inputs.size()) { - msg << "resolve_port: input " << port << " is out of range"; + msg << "resolve_port: hierarchical block '" << d_owner->name() + << "': input " << port << " is out of range"; throw std::runtime_error(msg.str()); } if (d_inputs[port].empty()) { - msg << "hierarchical block '" << d_owner->name() << "' input " << port - << " is not connected internally"; + msg << "resolve_port: hierarchical block '" << d_owner->name() + << "': input " << port << " is not connected internally"; throw std::runtime_error(msg.str()); } @@ -337,13 +338,14 @@ gr_hier_block2_detail::resolve_port(int port, bool is_input) } else { if (port < 0 || port >= (signed)d_outputs.size()) { - msg << "resolve_port: output " << port << " is out of range"; + msg << "resolve_port: hierarchical block '" << d_owner->name() + << "': output " << port << " is out of range"; throw std::runtime_error(msg.str()); } if (d_outputs[port] == gr_endpoint()) { - msg << "hierarchical block '" << d_owner->name() << "' output " << port - << " is not connected internally"; + msg << "resolve_port: hierarchical block '" << d_owner->name() + << "': output " << port << " is not connected internally"; throw std::runtime_error(msg.str()); } @@ -351,7 +353,8 @@ gr_hier_block2_detail::resolve_port(int port, bool is_input) } if (result.empty()) { - msg << "unable to resolve " + msg << "resolve_port: hierarchical block '" << d_owner->name() + << "': unable to resolve " << (is_input ? "input port " : "output port ") << port; throw std::runtime_error(msg.str()); -- cgit