From b484b6e625a8dbca209afb884af2125a0368775c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Mon, 18 Nov 2024 11:43:19 +0100
Subject: [PATCH] =?UTF-8?q?Simplification=20using=20the=20=E2=80=9Ccatch?=
 =?UTF-8?q?=20VALUE=E2=80=9D=20syntax?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It has been available in Octave for a long time.
---
 src/mtest.m | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/mtest.m b/src/mtest.m
index 703375c..2db273a 100644
--- a/src/mtest.m
+++ b/src/mtest.m
@@ -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');
-- 
GitLab