public async Task <ActionResult <DirectoryInfoFile> > GetDirectoryInfo(string path) { try { UserHelper requestingUser = _controllerHelper.GetRequestingUser(this); return(await _directoryLogic.GetDirectoryInfo(path, requestingUser.Uuid)); } catch (FileNotFoundException) { return(NotFound()); } catch (UnprocessableException) { return(StatusCode(StatusCodes.Status422UnprocessableEntity)); } catch (Exception e) { _logLogic.Log(e); return(StatusCode(StatusCodes.Status500InternalServerError)); } }
public void GetDirectoryInfoUnprocessableExceptionTest() { Assert.ThrowsAsync <UnprocessableException>(() => _directoryLogic.GetDirectoryInfo(null, Guid.Empty)); }