libzypp  13.10.6
UserRequestException.cc
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #include <iostream>
13 //#include "zypp/base/Logger.h"
14 
16 
17 using std::endl;
18 
20 namespace 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
const std::string & msg() const
Return the message string provided to the ctor.
Definition: Exception.h:185
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
UserRequestException(const std::string &msg_r=std::string())
Base class for Exception.
Definition: Exception.h:143