summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/error.cc16
-rw-r--r--apt-pkg/contrib/error.h16
2 files changed, 32 insertions, 0 deletions
diff --git a/apt-pkg/contrib/error.cc b/apt-pkg/contrib/error.cc
index d63b06d13..e2e8d6e57 100644
--- a/apt-pkg/contrib/error.cc
+++ b/apt-pkg/contrib/error.cc
@@ -92,6 +92,14 @@ bool GlobalError::DebugE(const char *Function,const char *Description,...) {
return InsertErrno(DEBUG, Function, Description, args);
}
/*}}}*/
+// GlobalError::InsertErrno - Get part of the errortype string from errno/*{{{*/
+bool GlobalError::InsertErrno(MsgType const &type, const char *Function,
+ const char *Description,...) {
+ va_list args;
+ va_start(args,Description);
+ return InsertErrno(type, Function, Description, args);
+}
+ /*}}}*/
// GlobalError::InsertErrno - formats an error message with the errno /*{{{*/
bool GlobalError::InsertErrno(MsgType type, const char* Function,
const char* Description, va_list &args) {
@@ -138,6 +146,14 @@ bool GlobalError::Debug(const char *Description,...)
return Insert(DEBUG, Description, args);
}
/*}}}*/
+// GlobalError::Insert - Add a errotype message to the list /*{{{*/
+bool GlobalError::Insert(MsgType const &type, const char *Description,...)
+{
+ va_list args;
+ va_start(args,Description);
+ return Insert(type, Description, args);
+}
+ /*}}}*/
// GlobalError::Insert - Insert a new item at the end /*{{{*/
bool GlobalError::Insert(MsgType type, const char* Description,
va_list &args) {
diff --git a/apt-pkg/contrib/error.h b/apt-pkg/contrib/error.h
index 4af0302c0..ae756dbc4 100644
--- a/apt-pkg/contrib/error.h
+++ b/apt-pkg/contrib/error.h
@@ -114,6 +114,15 @@ public: /*{{{*/
*/
bool DebugE(const char *Function,const char *Description,...) __like_printf(3) __cold;
+ /** \brief adds an errno message with the given type
+ *
+ * \param type of the error message
+ * \param Function which failed
+ * \param Description of the error
+ */
+ bool InsertErrno(MsgType const &type, const char* Function,
+ const char* Description,...) __like_printf(4) __cold;
+
/** \brief add an fatal error message to the list
*
* Most of the stuff we consider as "error" is also "fatal" for
@@ -169,6 +178,13 @@ public: /*{{{*/
*/
bool Debug(const char *Description,...) __like_printf(2) __cold;
+ /** \brief adds an error message with the given type
+ *
+ * \param type of the error message
+ * \param Description of the error
+ */
+ bool Insert(MsgType const &type, const char* Description,...) __like_printf(3) __cold;
+
/** \brief is an error in the list?
*
* \return \b true if an error is included in the list, \b false otherwise