Skip to content

Commit

Permalink
File: handle EACCES
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekotekina committed Feb 11, 2017
1 parent b407d12 commit ef1eff6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Utilities/File.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ static fs::error to_error(DWORD e)
{
case ERROR_FILE_NOT_FOUND: return fs::error::noent;
case ERROR_PATH_NOT_FOUND: return fs::error::noent;
case ERROR_ACCESS_DENIED: return fs::error::acces;
case ERROR_ALREADY_EXISTS: return fs::error::exist;
case ERROR_FILE_EXISTS: return fs::error::exist;
case ERROR_NEGATIVE_SEEK: return fs::error::inval;
Expand Down Expand Up @@ -119,6 +120,7 @@ static fs::error to_error(int e)
case ENOENT: return fs::error::noent;
case EEXIST: return fs::error::exist;
case EINVAL: return fs::error::inval;
case EACCES: return fs::error::acces;
default: fmt::throw_exception("Unknown system error: %d.", e);
}
}
Expand Down
1 change: 1 addition & 0 deletions Utilities/File.h
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ namespace fs
inval,
noent,
exist,
acces,
};

// Error code returned
Expand Down

0 comments on commit ef1eff6

Please sign in to comment.