コード例 #1
0
        public IActionResult CreateBoard()
        {
            try
            {
                string username = GetCurrentUserName();
                _battleshipGameService.CreateBoard(username, _config.Value.BoardSize);
                return(ResponseMessageHelper.OkCreated("Board created"));
            }
            catch (BattleshipGameException ex)
            {
                return(ResponseMessageHelper.BadRequest(ex.Message));
            }
            catch (Exception ex)
            {
                //write exception to a error log

                return(ResponseMessageHelper.InternalServerError());
            }
        }