From ee0edc23ad8a875b4766a8aa3124643002c42e4c Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Fri, 10 Oct 2025 08:47:07 +0200 Subject: [PATCH] Fix error handling in freqresp for compatibility with Julia v1.12 --- lib/ControlSystemsBase/src/freqresp.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ControlSystemsBase/src/freqresp.jl b/lib/ControlSystemsBase/src/freqresp.jl index 36ffcd279..b923e57fd 100644 --- a/lib/ControlSystemsBase/src/freqresp.jl +++ b/lib/ControlSystemsBase/src/freqresp.jl @@ -127,8 +127,8 @@ _freq(w, te::Discrete) = cis(w*te.Ts) Q = Matrix(F.Q) catch e # For matrix types that do not have a hessenberg implementation, we call the standard version of freqresp. - e isa Union{MethodError, ErrorException} && return freqresp_nohess!(R, sys, w_vec) - # ErrorException appears if we try to access Q on a type which does not have Q as a field or property, notably HessenbergFactorization from GenericLinearAlgebra + (e isa @static VERSION < v"1.12" ? Union{MethodError, ErrorException} : Union{MethodError, ErrorException, FieldError}) && return freqresp_nohess!(R, sys, w_vec) + # ErrorException appears if we try to access Q on a type which does not have Q as a field or property, notably HessenbergFactorization from GenericLinearAlgebra, on julia v1.12, this is instead a FieldError rethrow() end A = F.H