Home > matlab > mexErrCheck.m

mexErrCheck

PURPOSE ^

function mexErrCheck(mexFunctionName, err)

SYNOPSIS ^

function mexErrCheck(mexFunctionName, err)

DESCRIPTION ^

 function mexErrCheck(mexFunctionName, err)
 this function halts processing if err is equal to 1.

 INPUTS
   mexFunctionName [char]    Name of the mexFunction
   err             [double]  error code returned from mexFunction

 OUTPUTS
   none.

 ALGORITHM
   ...

 SPECIAL REQUIREMENTS
   none.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function mexErrCheck(mexFunctionName, err)
0002 % function mexErrCheck(mexFunctionName, err)
0003 % this function halts processing if err is equal to 1.
0004 %
0005 % INPUTS
0006 %   mexFunctionName [char]    Name of the mexFunction
0007 %   err             [double]  error code returned from mexFunction
0008 %
0009 % OUTPUTS
0010 %   none.
0011 %
0012 % ALGORITHM
0013 %   ...
0014 %
0015 % SPECIAL REQUIREMENTS
0016 %   none.
0017 %
0018 
0019 % Copyright (C) 2010 Dynare Team
0020 %
0021 % This file is part of Dynare.
0022 %
0023 % Dynare is free software: you can redistribute it and/or modify
0024 % it under the terms of the GNU General Public License as published by
0025 % the Free Software Foundation, either version 3 of the License, or
0026 % (at your option) any later version.
0027 %
0028 % Dynare is distributed in the hope that it will be useful,
0029 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0030 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0031 % GNU General Public License for more details.
0032 %
0033 % You should have received a copy of the GNU General Public License
0034 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
0035 
0036 if ~ischar(mexFunctionName) || ~isscalar(err)
0037     error('The first argument must be a char and the second a scalar');
0038 end
0039 
0040 if err
0041     error(['Error encountered in: ' mexFunctionName '.']);
0042 end

Generated on Tue 22-May-2012 02:40:23 by m2html © 2005