libzypp  17.31.0
ZYPP_THROW macros

Macros for throwing Exception. More...

Macros

#define ZYPP_THROW(EXCPT)   ::zypp::exception_detail::do_ZYPP_THROW( EXCPT, ZYPP_EX_CODELOCATION )
 Drops a logline and throws the Exception. More...
 
#define ZYPP_EXCPT_PTR(EXCPT)   ::zypp::exception_detail::do_ZYPP_EXCPT_PTR( EXCPT, ZYPP_EX_CODELOCATION )
 Drops a logline and returns Exception as a std::exception_ptr. More...
 
#define ZYPP_CAUGHT(EXCPT)   ::zypp::exception_detail::do_ZYPP_CAUGHT( EXCPT, ZYPP_EX_CODELOCATION )
 Drops a logline telling the Exception was caught (in order to handle it). More...
 
#define ZYPP_RETHROW(EXCPT)   ::zypp::exception_detail::do_ZYPP_RETHROW( EXCPT, ZYPP_EX_CODELOCATION )
 Drops a logline and rethrows, updating the CodeLocation. More...
 
#define ZYPP_THROW_MSG(EXCPTTYPE, MSG)   ZYPP_THROW( EXCPTTYPE( MSG ) )
 Throw Exception built from a message string. More...
 
#define ZYPP_THROW_ERRNO(EXCPTTYPE)   ZYPP_THROW( EXCPTTYPE( ::zypp::Exception::strErrno(errno) ) )
 Throw Exception built from errno. More...
 
#define ZYPP_THROW_ERRNO1(EXCPTTYPE, ERRNO)   ZYPP_THROW( EXCPTTYPE( ::zypp::Exception::strErrno(ERRNO) ) )
 Throw Exception built from errno provided as argument. More...
 
#define ZYPP_THROW_ERRNO_MSG(EXCPTTYPE, MSG)   ZYPP_THROW( EXCPTTYPE( ::zypp::Exception::strErrno(errno,MSG) ) )
 Throw Exception built from errno and a message string. More...
 
#define ZYPP_THROW_ERRNO_MSG1(EXCPTTYPE, ERRNO, MSG)   ZYPP_THROW( EXCPTTYPE( ::zypp::Exception::strErrno(ERRNO,MSG) ) )
 Throw Exception built from errno provided as argument and a message string. More...
 

Detailed Description

Macros for throwing Exception.

See also
zypp::Exception for an example.

Macro Definition Documentation

◆ ZYPP_THROW

#define ZYPP_THROW (   EXCPT)    ::zypp::exception_detail::do_ZYPP_THROW( EXCPT, ZYPP_EX_CODELOCATION )

Drops a logline and throws the Exception.

Definition at line 428 of file Exception.h.

◆ ZYPP_EXCPT_PTR

#define ZYPP_EXCPT_PTR (   EXCPT)    ::zypp::exception_detail::do_ZYPP_EXCPT_PTR( EXCPT, ZYPP_EX_CODELOCATION )

Drops a logline and returns Exception as a std::exception_ptr.

Definition at line 432 of file Exception.h.

◆ ZYPP_CAUGHT

#define ZYPP_CAUGHT (   EXCPT)    ::zypp::exception_detail::do_ZYPP_CAUGHT( EXCPT, ZYPP_EX_CODELOCATION )

Drops a logline telling the Exception was caught (in order to handle it).

Definition at line 436 of file Exception.h.

◆ ZYPP_RETHROW

#define ZYPP_RETHROW (   EXCPT)    ::zypp::exception_detail::do_ZYPP_RETHROW( EXCPT, ZYPP_EX_CODELOCATION )

Drops a logline and rethrows, updating the CodeLocation.

Definition at line 440 of file Exception.h.

◆ ZYPP_THROW_MSG

#define ZYPP_THROW_MSG (   EXCPTTYPE,
  MSG 
)    ZYPP_THROW( EXCPTTYPE( MSG ) )

Throw Exception built from a message string.

Definition at line 445 of file Exception.h.

◆ ZYPP_THROW_ERRNO

#define ZYPP_THROW_ERRNO (   EXCPTTYPE)    ZYPP_THROW( EXCPTTYPE( ::zypp::Exception::strErrno(errno) ) )

Throw Exception built from errno.

Definition at line 449 of file Exception.h.

◆ ZYPP_THROW_ERRNO1

#define ZYPP_THROW_ERRNO1 (   EXCPTTYPE,
  ERRNO 
)    ZYPP_THROW( EXCPTTYPE( ::zypp::Exception::strErrno(ERRNO) ) )

Throw Exception built from errno provided as argument.

Definition at line 453 of file Exception.h.

◆ ZYPP_THROW_ERRNO_MSG

#define ZYPP_THROW_ERRNO_MSG (   EXCPTTYPE,
  MSG 
)    ZYPP_THROW( EXCPTTYPE( ::zypp::Exception::strErrno(errno,MSG) ) )

Throw Exception built from errno and a message string.

Definition at line 457 of file Exception.h.

◆ ZYPP_THROW_ERRNO_MSG1

#define ZYPP_THROW_ERRNO_MSG1 (   EXCPTTYPE,
  ERRNO,
  MSG 
)    ZYPP_THROW( EXCPTTYPE( ::zypp::Exception::strErrno(ERRNO,MSG) ) )

Throw Exception built from errno provided as argument and a message string.

Definition at line 461 of file Exception.h.