Another option: put the try catch inside the inner loop where you are doing the 
failing operation.

> On May 19, 2016, at 5:36 AM, Fluid Dynamics <a2093...@trbvm.com> wrote:
> 
>> On Thursday, May 19, 2016 at 7:50:57 AM UTC-4, khairul isan wrote:
>> Hello all,
>> 
>> I have problem on handle many lazy sequence,
>> 
>> (try
>>    (for [x [1 2 3 "b"]]
>>       (for [n [1 2 3 4]]
>>         (+ x n)))
>>    (catch Throwable e
>>      (pr-str e)))
>> 
>> When i handle but error not in catch.
>> Any solution ?
>> 
>> Thanks
> 
> The lazy sequence isn't being realized until after the try block exits. If 
> *both* fors are wrapped in (doall ... ) the exception gets caught, because 
> then the calculations (and the error) happen while still inside of the try 
> body.
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to