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); } }