libzypp: zypp-core/base/userrequestexception.cc Source File

libzypp 17.38.9

userrequestexception.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#include <iostream>
13//#include <zypp-core/base/Logger.h>
14
15#include <zypp-core/base/UserRequestException>
16
17using std::endl;
18
20namespace zypp
21{
22
24 //
25 // METHOD NAME : UserRequestException::UserRequestException
26 // METHOD TYPE : Ctor
27 //
28 UserRequestException::UserRequestException( const std::string & msg_r )
29 : Exception( msg_r ), _kind( UNSPECIFIED )
30 {}
31
32 UserRequestException::UserRequestException( const std::string & msg_r, const Exception & history_r )
33 : Exception( msg_r, history_r ), _kind( UNSPECIFIED )
34 {}
35
36 UserRequestException::UserRequestException( Kind kind_r, const std::string & msg_r )
37 : Exception( msg_r ), _kind( kind_r )
38 {}
39
40 UserRequestException::UserRequestException( Kind kind_r, const std::string & msg_r, const Exception & history_r )
41 : Exception( msg_r, history_r ), _kind( kind_r )
42 {}
43
45 //
46 // METHOD NAME : UserRequestException::dumpOn
47 // METHOD TYPE : std::ostream &
48 //
49 std::ostream & UserRequestException::dumpOn( std::ostream & str ) const
50 {
51 switch ( _kind )
52 {
53 case UNSPECIFIED: str << "UNSPECIFIED"; break;
54 case IGNORE: str << "IGNORE"; break;
55 case SKIP: str << "SKIP"; break;
56 case RETRY: str << "RETRY"; break;
57 case ABORT: str << "ABORT"; break;
58 // no default !
59 }
60 return str << " request: " << msg();
61 }
62
64} // namespace zypp
zypp::Exception::Exception
Exception()
Default ctor.
Definition Exception.cc:94
zypp::Exception::msg
const std::string & msg() const
Return the message string provided to the ctor.
Definition Exception.h:206
zypp::UserRequestException::dumpOn
std::ostream & dumpOn(std::ostream &str) const override
Overload this to print a proper error message.
Definition userrequestexception.cc:49
zypp::UserRequestException::Kind
Kind
Definition userrequestexception.h:67
zypp::UserRequestException::ABORT
@ ABORT
Definition userrequestexception.h:67
zypp::UserRequestException::SKIP
@ SKIP
Definition userrequestexception.h:67
zypp::UserRequestException::UNSPECIFIED
@ UNSPECIFIED
Definition userrequestexception.h:67
zypp::UserRequestException::RETRY
@ RETRY
Definition userrequestexception.h:67
zypp::UserRequestException::IGNORE
@ IGNORE
Definition userrequestexception.h:67
zypp::UserRequestException::UserRequestException
UserRequestException(const std::string &msg_r=std::string())
Definition userrequestexception.cc:28
zypp::UserRequestException::_kind
Kind _kind
Definition userrequestexception.h:81
str
String related utilities and Regular expression matching.
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2