public IActionResult GetHealthStatus() { try { var healthStatus = _healthService.GetHealthStatus(); return(Ok(new IsAliveResponse { Env = healthStatus.EnvironmentInfo, IsDebug = healthStatus.IsDebug, Name = healthStatus.ApplicationName, Version = healthStatus.ApplicationVersion })); } catch (Exception e) { return(StatusCode ( (int)HttpStatusCode.InternalServerError, ErrorResponse.Create($"Service is unhealthy") )); } }