84#define YUI_EXCEPTION_CODE_LOCATION YCodeLocation(__FILE__,__FUNCTION__,__LINE__)
90#define YUI_THROW( EXCEPTION ) \
91 _YUI_THROW( ( EXCEPTION ), YUI_EXCEPTION_CODE_LOCATION )
96#define YUI_CAUGHT( EXCEPTION ) \
97 _YUI_CAUGHT( ( EXCEPTION ), YUI_EXCEPTION_CODE_LOCATION )
103#define YUI_RETHROW( EXCEPTION ) \
104 _YUI_RETHROW( ( EXCEPTION ), YUI_EXCEPTION_CODE_LOCATION )
110#define YUI_THROW_MSG( EXCEPTION_TYPE, MSG ) \
111 YUI_THROW( EXCEPTION_TYPE( MSG ) )
117#define YUI_THROW_ERRNO( EXCEPTION_TYPE ) \
118 YUI_THROW( EXCEPTION_TYPE( YUIException::strErrno( errno ) ) )
123#define YUI_THROW_ERRNO1( EXCEPTION_TYPE, ERRNO ) \
124 YUI_THROW( EXCEPTION_TYPE( YUIException::strErrno( ERRNO ) ) )
129#define YUI_THROW_ERRNO_MSG( EXCEPTION_TYPE, MSG) \
130 YUI_THROW( EXCEPTION_TYPE( YUIException::strErrno( errno, MSG ) ) )
135#define YUI_THROW_ERRNO_MSG1( EXCEPTION_TYPE, ERRNO,MSG ) \
136 YUI_THROW( EXCEPTION_TYPE( YUIException::strErrno( ERRNO, MSG ) ) )
147#define YUI_CHECK_NEW( PTR ) \
152 YUI_THROW( YUIOutOfMemoryException() ); \
162#define YUI_CHECK_PTR( PTR ) \
167 YUI_THROW( YUINullPointerException() ); \
191#define YUI_CHECK_WIDGET( WIDGET ) \
194 if ( ! ( static_cast<bool> (WIDGET) ) || \
195 ! (WIDGET)->isValid() ) \
197 YUI_THROW( YUIInvalidWidgetException() ); \
208#define YUI_CHECK_INDEX_MSG( INDEX, VALID_MIN, VALID_MAX, MSG ) \
211 if ( (INDEX) < (VALID_MIN) || \
212 (INDEX) > (VALID_MAX) ) \
214 YUI_THROW( YUIIndexOutOfRangeException( (INDEX), (VALID_MIN), (VALID_MAX), (MSG) ) ); \
219#define YUI_CHECK_INDEX( INDEX, VALID_MIN, VALID_MAX ) \
220 YUI_CHECK_INDEX_MSG( (INDEX), (VALID_MIN), (VALID_MAX), "")
237 const std::string &
func_r,
254 std::string
file()
const {
return _file; }
259 std::string
func()
const {
return _func; }
264 int line()
const {
return _line; }
334 const std::string &
msg()
const
364 const char *
const prefix );
371 {
return _msg.c_str(); }
378 virtual std::ostream &
dumpOn( std::ostream &
str )
const;
392 std::ostream & dumpError( std::ostream &
str )
const;
541 virtual std::ostream &
dumpOn( std::ostream &
str )
const = 0;
570 virtual std::ostream &
dumpOn( std::ostream &
str )
const;
595 YPropertyType
type()
const {
return _type; }
603 virtual std::ostream &
dumpOn( std::ostream &
str )
const;
631 virtual std::ostream &
dumpOn( std::ostream &
str )
const;
641 const std::string & message =
"" )
654 virtual std::ostream &
dumpOn( std::ostream &
str )
const;
686 virtual std::ostream &
dumpOn( std::ostream &
str )
const
688 std::string widgetClass =
692 return str <<
"Too many children for "
742 virtual std::ostream &
dumpOn( std::ostream &
str )
const
753 <<
" is not a child of "
796 :
YUIException(
"Invalid dimension (neither YD_HORIZ nor YD_VERT)" )
821 const std::string &
msg =
"" )
852 virtual std::ostream &
dumpOn( std::ostream &
str )
const
857 prefix =
"Index out of range";
859 return str <<
prefix <<
": " << _invalidIndex
860 <<
" valid: " << _validMin <<
" .. " << _validMax
926template<
class _Exception>
938template<
class _Exception>
948template<
class _Exception>
Definition YUIException.h:230
std::string asString() const
Definition YUIException.cc:42
std::string func() const
Definition YUIException.h:259
std::string file() const
Definition YUIException.h:254
friend std::ostream & operator<<(std::ostream &str, const YCodeLocation &obj)
int line() const
Definition YUIException.h:264
YCodeLocation(const std::string &file_r, const std::string &func_r, int line_r)
Definition YUIException.h:236
YCodeLocation()
Definition YUIException.h:247
Definition YProperty.h:52
Definition YUIException.h:636
virtual std::ostream & dumpOn(std::ostream &str) const
Definition YUIException.cc:197
Definition YUIException.h:891
Definition YUIException.h:480
Definition YUIException.h:298
const YCodeLocation & where() const
Definition YUIException.h:320
static std::string strErrno(int errno_r, const std::string &msg)
static std::string strErrno(int errno_r)
Definition YUIException.cc:112
void relocate(const YCodeLocation &newLocation) const
Definition YUIException.h:326
virtual ~YUIException()
Definition YUIException.cc:75
std::string asString() const
Definition YUIException.cc:82
virtual const char * what() const
Definition YUIException.h:370
virtual std::ostream & dumpOn(std::ostream &str) const
Definition YUIException.cc:91
void setMsg(const std::string &msg)
Definition YUIException.h:340
const std::string & msg() const
Definition YUIException.h:334
YUIException(const std::string &msg_r)
friend std::ostream & operator<<(std::ostream &str, const YUIException &obj)
YUIException()
Definition YUIException.cc:63
static void log(const YUIException &exception, const YCodeLocation &location, const char *const prefix)
Definition YUIException.cc:128
Definition YUIException.h:808
int validMin() const
Definition YUIException.h:839
virtual std::ostream & dumpOn(std::ostream &str) const
Definition YUIException.h:852
int validMax() const
Definition YUIException.h:844
int invalidIndex() const
Definition YUIException.h:834
YUIIndexOutOfRangeException(int invalidIndex, int validMin, int validMax, const std::string &msg="")
Definition YUIException.h:818
Definition YUIException.h:713
YWidget * container() const
Definition YUIException.h:729
YWidget * child() const
Definition YUIException.h:734
virtual std::ostream & dumpOn(std::ostream &str) const
Definition YUIException.h:742
Definition YUIException.h:793
Definition YUIException.h:468
Definition YUIException.h:408
Definition YUIException.h:424
Definition YUIException.h:876
Definition YUIException.h:507
YProperty property() const
Definition YUIException.h:523
void setWidget(YWidget *w)
Definition YUIException.h:533
virtual std::ostream & dumpOn(std::ostream &str) const =0
YWidget * widget() const
Definition YUIException.h:528
Definition YUIException.h:579
YPropertyType type() const
Definition YUIException.h:595
virtual std::ostream & dumpOn(std::ostream &str) const
Definition YUIException.cc:162
Definition YUIException.h:614
virtual std::ostream & dumpOn(std::ostream &str) const
Definition YUIException.cc:181
Definition YUIException.h:492
Definition YUIException.h:664
virtual std::ostream & dumpOn(std::ostream &str) const
Definition YUIException.h:686
YWidget * container() const
Definition YUIException.h:678
Definition YUIException.h:554
virtual std::ostream & dumpOn(std::ostream &str) const
Definition YUIException.cc:141