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/Event.hpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src/server/Event.hpp') diff --git a/src/server/Event.hpp b/src/server/Event.hpp index 963671ab..5f2e99bb 100644 --- a/src/server/Event.hpp +++ b/src/server/Event.hpp @@ -78,13 +78,6 @@ public: /** Return the status (success or error code) of this event. */ Status status() const { return _status; } - /** Respond to the originating client. */ - void respond(Status status) { - if (_request_client) { - _request_client->response(_request_id, status); - } - } - protected: Event(Engine& engine, SharedPtr client, int32_t id, FrameTime time) : _engine(engine) @@ -107,12 +100,27 @@ protected: return !st; } + inline bool pre_process_done(Status st, const Raul::URI& subject) { + _status = st; + _err_subject = subject.str(); + return !st; + } + + /** Respond to the originating client. */ + inline Status respond() { + if (_request_client) { + _request_client->response(_request_id, _status, _err_subject); + } + return _status; + } + Engine& _engine; Raul::AtomicPtr _next; SharedPtr _request_client; int32_t _request_id; FrameTime _time; Status _status; + std::string _err_subject; }; } // namespace Server -- cgit v1.2.1