Skip to content
Snippets Groups Projects
Verified Commit b484b6e6 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Simplification using the “catch VALUE” syntax

It has been available in Octave for a long time.
parent c5ce7645
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,7 @@ function [check, info] = mtest(fname, fpath)
% - If two input arguments are provided, fname is the base name of the targeted
% matlab routine and fpath is the path to this routine.
% Copyright © 2013-2023 Dynare Team
% Copyright © 2013-2024 Dynare Team
%
% This file is part of Dynare (m-unit-tests module).
%
......@@ -102,12 +102,10 @@ for i=1:nn
fprintf(tid,str);
end
fprintf(tid,'LOG = NaN;\n');
fprintf(tid,'catch exception\n');
if isoctave
fprintf(tid,'catch\n');
fprintf(tid,'exception = lasterror;\n');
fprintf(tid, 'LOG = ''%s'';\n','The Log output is not available with Octave!');
else
fprintf(tid,'catch exception\n');
fprintf(tid,'LOG = getReport(exception,''extended'');\n');
end
fprintf(tid,'T = NaN;\n');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment