From 5226db4b3cb9efe477ab92ece5b17c54edc2c511 Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx.de>
Date: Tue, 11 Oct 2022 16:12:03 +0200
Subject: [PATCH] logarithmic_reduction.m: add missing error codes

---
 matlab/dsge_likelihood.m   | 3 ++-
 matlab/get_error_message.m | 6 ++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/matlab/dsge_likelihood.m b/matlab/dsge_likelihood.m
index b0a00a151b..72395f1667 100644
--- a/matlab/dsge_likelihood.m
+++ b/matlab/dsge_likelihood.m
@@ -217,7 +217,8 @@ if info(1)
     if info(1) == 3 || info(1) == 4 || info(1) == 5 || info(1)==6 ||info(1) == 19 ||...
                 info(1) == 20 || info(1) == 21 || info(1) == 23 || info(1) == 26 || ...
                 info(1) == 81 || info(1) == 84 ||  info(1) == 85 ||  info(1) == 86 || ...
-                info(1) == 401 || info(1) == 402 || info(1) == 403 %cycle reduction
+                info(1) == 401 || info(1) == 402 || info(1) == 403 || ... %cycle reduction
+                info(1) == 411 || info(1) == 412 || info(1) == 413 % logarithmic reduction
         %meaningful second entry of output that can be used
         fval = Inf;
         info(4) = info(2);
diff --git a/matlab/get_error_message.m b/matlab/get_error_message.m
index 7612e2f0d9..8b463f619b 100644
--- a/matlab/get_error_message.m
+++ b/matlab/get_error_message.m
@@ -196,6 +196,12 @@ switch info(1)
         message = 'Cycle reduction terminated with NaN/Inf.';
     case 403
         message = 'Cycle reduction converged to a solution that does not solve the matrix equation.';
+    case 411
+        message = 'Logarithmic reduction reached the iteration limit. Try increasing maxit.';
+    case 412
+        message = 'Logarithmic reduction terminated with NaN/Inf.';
+    case 413
+        message = 'Logarithmic reduction converged to a solution that does not solve the matrix equation.';
     otherwise
         message = 'This case shouldn''t happen. Contact the authors of Dynare';
 end
\ No newline at end of file
-- 
GitLab