public async Task <IActionResult> DeleteScriptTypeAsync(int Id) { _logger.LogInformation("Delete script type with id : {id}", Id); try { await _scriptService.DeleteTypeAsync(Id); _logger.LogInformation("Script type deleted"); return(Ok()); } catch (AppException ex) { _logger.LogWarning(ex, "Failed to delete script type"); return(BadRequest(new { message = ex.Message })); } catch (Exception ex) { _logger.LogError(ex, "Fatal failure during scrip type deletion"); return(StatusCode(StatusCodes.Status500InternalServerError, new { message = "Fatal internal error. Please contact administrator" })); } }