except: rename errno_error::id to m_code
This commit is contained in:
parent
b1eb9982d1
commit
354573f369
13
except.cpp
13
except.cpp
@ -29,11 +29,11 @@ using util::errno_error;
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
/// Construct an errno_error from a given error value. The error value MUST signal an error at
|
/// Construct an errno_error from a given error value. The error value MUST signal an error at
|
||||||
/// construction time.
|
/// construction time.
|
||||||
errno_error::errno_error (int _errno):
|
errno_error::errno_error (int _code):
|
||||||
runtime_error (strerror (_errno)),
|
runtime_error (strerror (_code)),
|
||||||
id (_errno)
|
m_code (_code)
|
||||||
{
|
{
|
||||||
CHECK_NEQ (_errno, 0);
|
CHECK_NEQ (_code, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -41,10 +41,9 @@ errno_error::errno_error (int _errno):
|
|||||||
/// Construct an errno_error from the current value of errno. errno MUST signal an error at
|
/// Construct an errno_error from the current value of errno. errno MUST signal an error at
|
||||||
/// construction time.
|
/// construction time.
|
||||||
errno_error::errno_error ():
|
errno_error::errno_error ():
|
||||||
runtime_error (strerror (errno)),
|
errno_error (last_code ())
|
||||||
id (errno)
|
|
||||||
{
|
{
|
||||||
CHECK_NEQ (errno, 0);
|
CHECK_NEQ (m_code, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
18
except.hpp
18
except.hpp
@ -49,16 +49,18 @@ namespace util {
|
|||||||
|
|
||||||
/// An exception class used for reporting errors signalled by errno.
|
/// An exception class used for reporting errors signalled by errno.
|
||||||
class errno_error : public std::runtime_error {
|
class errno_error : public std::runtime_error {
|
||||||
public:
|
public:
|
||||||
int id;
|
errno_error (int code);
|
||||||
errno_error (int _errno);
|
errno_error ();
|
||||||
errno_error ();
|
|
||||||
|
|
||||||
static void try_code (void);
|
static void try_code (void);
|
||||||
static void try_code (int code);
|
static void try_code (int code);
|
||||||
|
|
||||||
static void throw_code [[gnu::noreturn]] (void);
|
static void throw_code [[gnu::noreturn]] (void);
|
||||||
static void throw_code [[gnu::noreturn]] (int code);
|
static void throw_code [[gnu::noreturn]] (int code);
|
||||||
|
|
||||||
|
private:
|
||||||
|
int m_code;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user