From dabad1d0cf46263d78558d79d2af9fff528a9a89 Mon Sep 17 00:00:00 2001 From: Hivert Quentin Date: Tue, 24 Jun 2025 10:20:12 +0200 Subject: [PATCH] fix(api): add handler for internal error --- API/SOGoAPIDispatcher.m | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/API/SOGoAPIDispatcher.m b/API/SOGoAPIDispatcher.m index ac820618c..a6992481c 100644 --- a/API/SOGoAPIDispatcher.m +++ b/API/SOGoAPIDispatcher.m @@ -371,20 +371,20 @@ void handle_api_terminate(int signum) } //Execute action - // NS_DURING - // { + NS_DURING + { ret = [classAction action: context withParam: paramInjected]; - // } - // NS_HANDLER - // { - // error = [NSString stringWithFormat: @"Internal error during: %@", action]; - // [self errorWithFormat: error]; - // [self _sendAPIErrorResponse: theResponse withMessage: error withStatus: 500]; - // RELEASE(context); - // RELEASE(pool); - // return nil; - // } - // NS_ENDHANDLER; + } + NS_HANDLER + { + error = [NSString stringWithFormat: @"Internal error during: %@", action]; + [self errorWithFormat: error]; + [self _sendAPIErrorResponse: theResponse withMessage: error withStatus: 500]; + RELEASE(context); + RELEASE(pool); + return nil; + } + NS_ENDHANDLER; //Make the response