zypp::UserRequestException Class Reference

Base for exceptions caused by explicit user request. More...

#include <UserRequestException.h>

Inheritance diagram for zypp::UserRequestException:
[legend]

List of all members.

Public Types

enum  Kind {
  UNSPECIFIED, IGNORE, SKIP, RETRY,
  ABORT
}

Public Member Functions

 UserRequestException (const std::string &msg_r=std::string())
 UserRequestException (Kind kind_r, const std::string &msg_r=std::string())
Kind kind () const

Protected Member Functions

virtual std::ostream & dumpOn (std::ostream &str) const
 Overload this to print a proper error message.

Private Attributes

Kind _kind


Detailed Description

Base for exceptions caused by explicit user request.

Use the derived convenience classes to throw exceptions of a certain kind.

     ProgressData ticks( makeProgressData( input_r ) );
     ticks.sendTo( fnc_r );
     ticks.toMin(); // start sending min (0)

     iostr::EachLine line( input_r );
     for( ; line; line.next() )
     {
       // process the line

       if ( ! ticks.set( input_r.stream().tellg() ) )
         ZYPP_THROW( AbortRequestException( "" ) );
     }
 // either this way
 catch ( const AbortRequestException & excpt_r )
 {
   ...
 }

 // or that
 catch ( const UserRequestException & excpt_r )
 {
   switch ( excpt_r.kind() )
   {
     case UserRequestException::ABORT:
       ...
       break;
   }
 }

Definition at line 64 of file UserRequestException.h.


Member Enumeration Documentation

Enumerator:
UNSPECIFIED 
IGNORE 
SKIP 
RETRY 
ABORT 

Definition at line 67 of file UserRequestException.h.


Constructor & Destructor Documentation

zypp::UserRequestException::UserRequestException ( const std::string &  msg_r = std::string()  )  [explicit]

Definition at line 28 of file UserRequestException.cc.

zypp::UserRequestException::UserRequestException ( Kind  kind_r,
const std::string &  msg_r = std::string() 
) [explicit]

Definition at line 32 of file UserRequestException.cc.


Member Function Documentation

Kind zypp::UserRequestException::kind (  )  const [inline]

Definition at line 74 of file UserRequestException.h.

References _kind.

std::ostream & zypp::UserRequestException::dumpOn ( std::ostream &  str  )  const [protected, virtual]

Overload this to print a proper error message.

Reimplemented from zypp::Exception.

Definition at line 41 of file UserRequestException.cc.

References _kind, ABORT, IGNORE, zypp::Exception::msg(), RETRY, SKIP, and UNSPECIFIED.


Member Data Documentation

Definition at line 79 of file UserRequestException.h.

Referenced by dumpOn(), and kind().


The documentation for this class was generated from the following files:

doxygen