From 3c5931bb13b5f88edcebb375fa6964dde8b85563 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 26 Jul 2012 15:27:03 +0000 Subject: 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 --- src/server/events/CreatePort.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/server/events/CreatePort.cpp') diff --git a/src/server/events/CreatePort.cpp b/src/server/events/CreatePort.cpp index 9ddb8894..b89a90cc 100644 --- a/src/server/events/CreatePort.cpp +++ b/src/server/events/CreatePort.cpp @@ -85,15 +85,15 @@ bool CreatePort::pre_process() { if (_port_type == PortType::UNKNOWN) { - return Event::pre_process_done(UNKNOWN_TYPE); + return Event::pre_process_done(UNKNOWN_TYPE, _path); } if (_engine.engine_store()->find_object(_path)) { - return Event::pre_process_done(_status); + return Event::pre_process_done(_status, _path); } if (!(_patch = _engine.engine_store()->find_patch(_path.parent()))) { - return Event::pre_process_done(PARENT_NOT_FOUND); + return Event::pre_process_done(PARENT_NOT_FOUND, _path.parent()); } const Shared::URIs& uris = _engine.world()->uris(); @@ -112,7 +112,7 @@ CreatePort::pre_process() _engine.world()->forge().make(old_n_ports))); } else if (index_i->second.type() != uris.forge.Int || index_i->second.get_int32() != old_n_ports) { - return Event::pre_process_done(BAD_INDEX); + return Event::pre_process_done(BAD_INDEX, _path); } const PropIter poly_i = _properties.find(uris.ingen_polyphonic); @@ -123,7 +123,7 @@ CreatePort::pre_process() if (!(_patch_port = _patch->create_port( *_engine.buffer_factory(), _path.symbol(), _port_type, _buf_type, buf_size, _is_output, polyphonic))) { - return Event::pre_process_done(CREATION_FAILED); + return Event::pre_process_done(CREATION_FAILED, _path); } _patch_port->properties().insert(_properties.begin(), _properties.end()); @@ -174,8 +174,7 @@ CreatePort::execute(ProcessContext& context) void CreatePort::post_process() { - respond(_status); - if (!_status) { + if (!respond()) { _engine.broadcaster()->put(_path, _update); } -- cgit v1.2.1