Provide default and copy constructor for AnyError

v0.27.3
Luis Díaz Más 7 years ago
parent 6e4404da81
commit 18690f4c54

@ -171,20 +171,15 @@ namespace Exiv2 {
easier for library users (they have the option of catching most easier for library users (they have the option of catching most
things via std::exception). things via std::exception).
*/ */
class AnyError : public std::exception { class EXIV2API AnyError : public std::exception {
public: public:
//! @name Creators AnyError();
//@{ AnyError(const AnyError& o);
//! Virtual destructor.
virtual ~AnyError() throw();
//@}
//! @name Accessors virtual ~AnyError() throw();
//@{ ///@brief Return the error code.
//! Return the error code.
virtual int code() const throw() =0; virtual int code() const throw() =0;
//@} };
}; // AnyError
//! %AnyError output operator //! %AnyError output operator
inline std::ostream& operator<<(std::ostream& os, const AnyError& error) inline std::ostream& operator<<(std::ostream& os, const AnyError& error)
@ -309,7 +304,7 @@ namespace Exiv2 {
//! @name Manipulators //! @name Manipulators
//@{ //@{
//! Assemble the error message from the arguments //! Assemble the error message from the arguments
void setMsg(); EXIV2API void setMsg();
//@} //@}
// DATA // DATA

@ -144,7 +144,7 @@ int main(int argc,const char** argv)
httpcon(url, useHttp1_0); httpcon(url, useHttp1_0);
isOk = true; isOk = true;
} }
} catch (Exiv2::AnyError& e) { } catch (const Exiv2::AnyError& e) {
std::cout << "Error: '" << e << "'" << std::endl; std::cout << "Error: '" << e << "'" << std::endl;
return -1; return -1;
} }

@ -210,6 +210,16 @@ namespace Exiv2 {
std::cerr << s; std::cerr << s;
} }
AnyError::AnyError(): std::exception()
{
}
AnyError::AnyError(const AnyError &o): std::exception(o)
{
}
AnyError::~AnyError() throw() AnyError::~AnyError() throw()
{ {
} }

Loading…
Cancel
Save