예제 #1
0
        public IActionResult GetAll(int number)
        {
            _logger.LogInformation("Request for AllMessages message " + number);
            try
            {
                var message = _matrixService.GetAllMessage(number);
                if (message == null)
                {
                    throw new MessageNotFoundException(number);
                }

                return(Ok(message));
            }
            catch (MessageNotFoundException msgEx)
            {
                return(StatusCode(500, msgEx));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }