diff options
author | David Robillard <d@drobilla.net> | 2012-07-26 15:27:03 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-07-26 15:27:03 +0000 |
commit | 3c5931bb13b5f88edcebb375fa6964dde8b85563 (patch) | |
tree | 9801897576b7fb9d8a9f700847c670f216fc93b7 /src/server/events/Connect.cpp | |
parent | b83ed4f83cf4c9b5054dcf55bea710313c369633 (diff) | |
download | ingen-3c5931bb13b5f88edcebb375fa6964dde8b85563.tar.gz ingen-3c5931bb13b5f88edcebb375fa6964dde8b85563.tar.bz2 ingen-3c5931bb13b5f88edcebb375fa6964dde8b85563.zip |
Report subject with errors to client for more meaningful error messages.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4556 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/events/Connect.cpp')
-rw-r--r-- | src/server/events/Connect.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp index b9ea148a..dc6f7b99 100644 --- a/src/server/events/Connect.cpp +++ b/src/server/events/Connect.cpp @@ -57,30 +57,32 @@ Connect::pre_process() PortImpl* tail = _engine.engine_store()->find_port(_tail_path); PortImpl* head = _engine.engine_store()->find_port(_head_path); - if (!tail || !head) { - return Event::pre_process_done(PORT_NOT_FOUND); + if (!tail) { + return Event::pre_process_done(PORT_NOT_FOUND, _tail_path.str()); + } else if (!head) { + return Event::pre_process_done(PORT_NOT_FOUND, _head_path.str()); } _dst_input_port = dynamic_cast<InputPort*>(head); _src_output_port = dynamic_cast<OutputPort*>(tail); if (!_dst_input_port || !_src_output_port) { - return Event::pre_process_done(DIRECTION_MISMATCH); + return Event::pre_process_done(DIRECTION_MISMATCH, _head_path.str()); } NodeImpl* const src_node = tail->parent_node(); NodeImpl* const dst_node = head->parent_node(); if (!src_node || !dst_node) { - return Event::pre_process_done(PARENT_NOT_FOUND); + return Event::pre_process_done(PARENT_NOT_FOUND, _head_path.str()); } if (src_node->parent() != dst_node->parent() && src_node != dst_node->parent() && src_node->parent() != dst_node) { - return Event::pre_process_done(PARENT_DIFFERS); + return Event::pre_process_done(PARENT_DIFFERS, _head_path.str()); } if (!EdgeImpl::can_connect(_src_output_port, _dst_input_port)) { - return Event::pre_process_done(TYPE_MISMATCH); + return Event::pre_process_done(TYPE_MISMATCH, _head_path); } if (src_node->parent_patch() != dst_node->parent_patch()) { @@ -100,7 +102,7 @@ Connect::pre_process() } if (_patch->has_edge(_src_output_port, _dst_input_port)) { - return Event::pre_process_done(EXISTS); + return Event::pre_process_done(EXISTS, _head_path); } _edge = SharedPtr<EdgeImpl>( @@ -151,8 +153,7 @@ Connect::execute(ProcessContext& context) void Connect::post_process() { - respond(_status); - if (!_status) { + if (!respond()) { _engine.broadcaster()->connect(_tail_path, _head_path); } } |