Mailinglist Archive: zypp-devel (68 mails)
| < Previous | Next > |
[zypp-devel] Long running actios aborted by user: Consider to throw AbortRequestException
- From: Michael Andres <ma@xxxxxxx>
- Date: Thu, 3 May 2007 15:34:56 +0200
- Message-id: <20070503133456.GA12020@xxxxxxx>
zypp/base/UserRequestException.h
By now provides 4 exceptions, all derived from UserRequestException:
IgnoreRequestException
SkipRequestException
RetryRequestException
AbortRequestException
Consider throwing these kinds of exception on bealf of a user request.
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( "" ) );
}
Calling code may either catch
AbortRequestException
or
UserRequestException
and test if excpt.kind() == UserRequestException::ABORT
--
cu,
Michael Andres
+------------------------------------------------------------------+
Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4
+------------------------------------------------------------------+
Michael Andres YaST Development ma@xxxxxxxxxx
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)
Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0
+------------------------------------------------------------------+
--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx
| < Previous | Next > |