From 6ba199c7d7bee1909107ee0b8cbaf749c575b310 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Mon, 5 Aug 2019 14:29:53 +0100 Subject: Content messages: Remove ERRORCODE, rework ERROR This reworks CONTENT_MSG_ERROR to be structured data and removes the CONTENT_MSG_ERRORCODE message kind. Signed-off-by: Daniel Silverstone --- content/content.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'content/content.c') diff --git a/content/content.c b/content/content.c index af4cdaac3..367a0e5d1 100644 --- a/content/content.c +++ b/content/content.c @@ -173,7 +173,8 @@ nserror content_llcache_callback(llcache_handle *llcache, case LLCACHE_EVENT_ERROR: /** \todo Error page? */ c->status = CONTENT_STATUS_ERROR; - msg_data.error = event->data.msg; + msg_data.errordata.errorcode = NSERROR_UNKNOWN; + msg_data.errordata.errormsg = event->data.msg; content_broadcast(c, CONTENT_MSG_ERROR, &msg_data); break; case LLCACHE_EVENT_PROGRESS: @@ -816,12 +817,13 @@ void content_broadcast_errorcode(struct content *c, nserror errorcode) assert(c); - data.errorcode = errorcode; + data.errordata.errorcode = errorcode; + data.errordata.errormsg = NULL; for (user = c->user_list->next; user != 0; user = next) { next = user->next; /* user may be destroyed during callback */ if (user->callback != 0) { - user->callback(c, CONTENT_MSG_ERRORCODE, + user->callback(c, CONTENT_MSG_ERROR, &data, user->pw); } } -- cgit v1.2.3