3 /// Exception classes used specifically by the plugin.
7 Copyright (C) 2006-2007, Net Direct Inc. (http://www.netdirect.ca/)
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU General Public License in the COPYING file at the
19 root directory of this project for more details.
23 #include <opensync/opensync.h>
25 //////////////////////////////////////////////////////////////////////////////
26 // osync_error exception class
28 osync_error
& osync_error::operator=(const osync_error
&other
)
30 // unref the existing error
32 osync_error_unref(&m_error
);
36 // copy over the new one
37 m_error
= other
.m_error
;
41 osync_error_ref(&m_error
);
46 osync_error::~osync_error() throw()
49 osync_error_unref(&m_error
);
52 std::string
osync_error::get_error_msg(OSyncError
*error
)
54 const char *msg
= osync_error_print(&error
);
56 return msg
; // can't pass null into ctor
58 return "(no error message: osync_error_print() returned NULL)";