io: use more appropriate exceptions in fd_ref
This commit is contained in:
parent
8df51f7830
commit
f559f3d912
10
io.cpp
10
io.cpp
@ -25,11 +25,13 @@
|
||||
#include "types/casts.hpp"
|
||||
|
||||
#include <cstdio>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <stdexcept>
|
||||
|
||||
|
||||
using namespace std;
|
||||
@ -96,7 +98,7 @@ fd_ref::fd_ref (int _fd):
|
||||
fd (_fd)
|
||||
{
|
||||
if (fd < 0)
|
||||
throw invalid_argument ("invalid file descriptor");
|
||||
throw std::invalid_argument ("invalid descriptor");
|
||||
}
|
||||
|
||||
|
||||
@ -108,7 +110,7 @@ fd_ref::fd_ref (const boost::filesystem::path &path, int flags):
|
||||
#endif
|
||||
{
|
||||
if (fd < 0)
|
||||
throw path_error (path);
|
||||
util::errno_error::throw_code ();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user