public void ProcessCall(ISocketWrapper socketWrapper) { var result = socketWrapper.PeekToString(9); Exception caughtException = null; // TODO: Add exception handlers for custom exceptions and pass // the exceptions to the respective return processor // Ex: BadRequestException -> HttpBadRequestReturnController try { IHttpCallProcessor callProcessor = VerifyAndExtractProcessor(result); callProcessor.ProcessCall(socketWrapper); } catch (Exception ex) { if (_exceptionHandler.HasResponse(ex.GetType().Name) == false) { throw; } caughtException = ex; } IHttpResponse response = null; if (caughtException != null) { response = _exceptionHandler.GetResponseFromException(caughtException); } }
public void ProcessCall(INetworkStreamWrapper socketWrapper) { var result = socketWrapper.PeekToString(9); Exception caughtException = null; IHttpResponse response = null; try { IHttpCallProcessor callProcessor = VerifyAndExtractProcessor(result); response = callProcessor.ProcessCall(socketWrapper); } catch (Exception ex) { if (_exceptionHandler.HasResponse(ex.GetType().Name) == false) { throw; } response = _exceptionHandler.GetResponseFromException(caughtException); } SendResponse(response, socketWrapper); }