Exemplo n.º 1
0
        public async Task <IActionResult> DeleteVideo(int videoId)
        {
            try
            {
                await _videoServices.DeleteVideoAsync(videoId);

                return(NoContent());
            }
            catch (CourseValidateException ex)
            {
                return(BadRequest(ex.Message));
            }
            catch (VideoUpdateException ex)
            {
                return(BadRequest(ex.Message));
            }
            catch (NotFoundException ex)
            {
                return(NotFound(ex.Message));
            }
            catch (Exception ex)
            {
                _logger.LogCritical($"DeleteVideo() Error: {ex}");
                return(StatusCode(500, "Internal Server Error"));
            }
        }