summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/error.cc
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2017-01-29 15:01:00 -0800
committerSam Bingner <sam@bingner.com>2020-07-17 00:22:23 -1000
commitbf52d8261295b37473df85c4d15130350ddb6f2a (patch)
treed89125003addce619c37586c9b9b364bc56f9a9d /apt-pkg/contrib/error.cc
parentd1fc58d91e2ef47c58adb19ac2c0c541f4bae45c (diff)
The entire concept of PendingError() is flawed :/.
Diffstat (limited to 'apt-pkg/contrib/error.cc')
-rw-r--r--apt-pkg/contrib/error.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/apt-pkg/contrib/error.cc b/apt-pkg/contrib/error.cc
index 3c397eaf8..143b99557 100644
--- a/apt-pkg/contrib/error.cc
+++ b/apt-pkg/contrib/error.cc
@@ -206,6 +206,15 @@ void GlobalError::Discard() {
PendingFlag = false;
}
/*}}}*/
+// GlobalError::ReturnError - convert a stored error to a return code /*{{{*/
+bool GlobalError::ReturnError() {
+ for (auto &message : Messages)
+ if (message.Type == ERROR)
+ message.Type = WARNING;
+ PendingFlag = false;
+ return false;
+}
+ /*}}}*/
// GlobalError::empty - does our error list include anything? /*{{{*/
bool GlobalError::empty(MsgType const &threshold) const {
if (PendingFlag == true)