io: record path in path_error
This commit is contained in:
parent
0af631e975
commit
18c3a1eaaf
15
io.cpp
15
io.cpp
@ -201,3 +201,18 @@ scoped_cwd::~scoped_cwd ()
|
|||||||
if (!chdir (m_original.c_str ()))
|
if (!chdir (m_original.c_str ()))
|
||||||
errno_error::throw_code ();
|
errno_error::throw_code ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
path_error::path_error (const boost::filesystem::path &_path):
|
||||||
|
runtime_error (format::render ("Unknown path: %!", m_path)),
|
||||||
|
m_path (_path)
|
||||||
|
{ ; }
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
const char*
|
||||||
|
path_error::path (void) const noexcept
|
||||||
|
{
|
||||||
|
return m_path.c_str ();
|
||||||
|
}
|
||||||
|
11
io.hpp
11
io.hpp
@ -134,10 +134,13 @@ namespace util {
|
|||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
class path_error : public std::runtime_error {
|
class path_error : public std::runtime_error {
|
||||||
public:
|
public:
|
||||||
path_error (const boost::filesystem::path &path):
|
path_error (const boost::filesystem::path &path);
|
||||||
runtime_error ("Invalid path " + path.string ())
|
|
||||||
{ ; }
|
const char* path (void) const noexcept;
|
||||||
|
|
||||||
|
private:
|
||||||
|
const boost::filesystem::path m_path;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user