diff --git a/src/variables.jl b/src/variables.jl
index 3d0df17b96b0a1bf3250bee3ac743afbe8520f4d..7220259d089daa5415da821098c965f7f4c84e7d 100644
--- a/src/variables.jl
+++ b/src/variables.jl
@@ -141,7 +141,7 @@ function _defvar(func_def, getter=nothing)
             new_def[:name] = Expr(:., fn_def[:name], QuoteNode(:f))
             new_def[:args] = esc.(fn_def[:args])
             new_def[:kwargs] = esc.(fn_def[:kwargs])
-            new_def[:body] = fn_def[:body]
+            new_def[:body] = esc(fn_def[:body])
             new_def[:whereparams] = esc.(fn_def[:whereparams])
             return MacroTools.combinedef(new_def)
         catch e
@@ -442,8 +442,12 @@ function scanner_constraints!(bb::AbstractBlock)
         try
             value = f(bb)
         catch e
-            if e isa VariableNotAvailable
                 continue
+                continue
+            else
+                rethrow()
+            end
+            continue
             else
                 rethrow()
             end