The problem is that the error from the macro evaluation is an error that 
gets raised when evaluating the source, so you need to put try outside the 
include of the file or use eval:

try 
   eval(:(@a))
end

You can also put the try block inside the macro.

Ivar


kl. 11:59:39 UTC+2 onsdag 22. oktober 2014 skrev Mauro følgende:
>
> Is it possibly to catch an error happening during macro evaluation? 
>
> Example: 
> ``` 
> macro a() 
>     error("error in marco itself") 
> end 
>
> macro b() 
>     :(error("error in marco generated code")) 
> end 
>
> # works: 
> try 
>     @b 
> end 
>
> # still errors: 
> try 
>     @a 
> end 
> ``` 
>
> How to `try` the error in `@a`? 
>

Reply via email to