Example #1
0
        public async Task <ActionResult> RemoveDirectory(string path)
        {
            try
            {
                UserHelper requestingUser = _controllerHelper.GetRequestingUser(this);
                await _directoryLogic.Delete(path, requestingUser);

                return(Ok());
            }
            catch (UnprocessableException)
            {
                return(UnprocessableEntity());
            }
            catch (UnauthorizedAccessException)
            {
                return(Unauthorized());
            }
            catch (Exception e)
            {
                _logLogic.Log(e);
                return(StatusCode(StatusCodes.Status500InternalServerError));
            }
        }
Example #2
0
 public void RemoveDirectoryUnprocessableExceptionTest()
 {
     Assert.ThrowsAsync <UnprocessableException>(() => _directoryLogic.Delete(null, new UserHelper()));
 }