Differences between revisions 1 and 6 (spanning 5 versions)
Revision 1 as of 2007-08-21 20:58:44
Size: 50
Editor: gtang
Comment:
Revision 6 as of 2007-08-21 21:01:07
Size: 432
Editor: gtang
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
 * Here is an example on throwing an exception:  * Here is an example on throwing an exception:
{{{
vector< float > EMData::calc_fourier_shell_correlation(EMData * with)
{
    if (!with) {
        throw NullPointerException("NULL input image");
    }
    if (!EMUtil::is_same_size(this, with)) {
        LOGERR("images not same size");
        throw ImageFormatException( "images not same size");
    }
//...
}
}}}
 * Here is an example on catching the exceptions:
  • Here is an example on throwing an exception:

vector< float > EMData::calc_fourier_shell_correlation(EMData * with)
{
    if (!with) {
        throw NullPointerException("NULL input image");
    }
    if (!EMUtil::is_same_size(this, with)) {
        LOGERR("images not same size");
        throw ImageFormatException( "images not same size");
    }
//...
}
  • Here is an example on catching the exceptions:

eman2Exception (last edited 2022-02-18 00:42:07 by TunayDurmaz)