Skip to content

Commit ee0edc2

Browse files
committed
Fix error handling in freqresp for compatibility with Julia v1.12
1 parent 523164e commit ee0edc2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/ControlSystemsBase/src/freqresp.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ _freq(w, te::Discrete) = cis(w*te.Ts)
127127
Q = Matrix(F.Q)
128128
catch e
129129
# For matrix types that do not have a hessenberg implementation, we call the standard version of freqresp.
130-
e isa Union{MethodError, ErrorException} && return freqresp_nohess!(R, sys, w_vec)
131-
# 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
130+
(e isa @static VERSION < v"1.12" ? Union{MethodError, ErrorException} : Union{MethodError, ErrorException, FieldError}) && return freqresp_nohess!(R, sys, w_vec)
131+
# 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
132132
rethrow()
133133
end
134134
A = F.H

0 commit comments

Comments
 (0)