Documentation for Ice 3.4. The latest release is Ice 3.7. Refer to the space directory for other releases.

This class is at the root of the derivation tree for Ice exceptions and encapsulates functionality that is common to all Ice and IceUtil exceptions:

C++
class Exception : public std::exception {
public:
    Exception();
    Exception(const char* file, int line);
    virtual ~Exception() throw();

    virtual std::string ice_name() const;
    virtual void ice_print(std::ostream&) const;
    virtual const char* what() const throw();
    virtual Exception* ice_clone() const;
    virtual void ice_throw() const;
    const char* ice_file() const;
    int ice_line() const;
};

The second constructor stores a file name and line number in the exception that are returned by the ice_file and ice_line member functions, respectively. This allows you to identify the source of an exception by passing the __FILE__ and __LINE__ preprocessor macros to the constructor.

The what member function is a synonym for ice_print. The default implementation of ice_print prints the file name, line number, and the name of the exception.

The remaining member functions are described in the C++ Mapping for Exceptions.

See Also
  • No labels