Add exceptions to Filesystem::setDirectory()