Пример #1
0
void testError ( CuTest *tc )
{
	const char* msg = "test";
	CLuceneError err ( 0,msg,false );
	CLuceneError err2 = err;
	CuAssert ( tc,_T ( "Error did not copy properly" ),err.what() !=err2.what() );
	CuAssert ( tc,_T ( "Error values did not correspond" ),strcmp ( err.what(),err2.what() ) ==0 );

	IndexReader* reader = NULL;
	try
	{
		RAMDirectory dir; _CL_DECREF(& dir);
		reader = IndexReader::open ( &dir,true );
	}
	catch ( CLuceneError& )
	{
		_CLDELETE ( reader );
	}
	catch ( ... )
	{
		_CLDELETE ( reader );
		CuAssert ( tc,_T ( "Error did not catch properly" ),false );
	}
}
Пример #2
0
Soprano::Error::Error Soprano::Index::exceptionToError( CLuceneError& err )
{
    return Error::Error( QString( "CLucene index error: '%1'" ).arg( err.what() ), Error::ErrorUnknown + err.number() );
}