Arc Forumnew | comments | leaders | submitlogin
How do I easily suppress an exception by temload?
1 point by lark 4661 days ago | 3 comments
When I try to load a file that does not exist, temload throws an exception:

open-input-file: cannot open input file: "/home/lark/arc/somedir/somefile" (No such file or directory; errno=2)

How do I easily suppress this? For instance, why can't temload simply return nil?



1 point by akkartik 4661 days ago | link

  arc> (errsafe:temload 'foo "x")
  nil
errsafe doesn't work with all errors, but it works in this case.

-----

1 point by lark 4661 days ago | link

I still get the same error. Hmm.

I don't get the error if I call errsafe:temload before the (asv) call.

I don't get the error if I call errsafe:temload within a defop.

I don't get the error if I call errsafe:temload from a def called by a defop.

But I still get the error in the code I'm running right now. I'm confused now.

-----

1 point by akkartik 4661 days ago | link

Just thinking aloud: is there another temload in your code? Is some other function besides temload trying to open that file?

Feel free to paste in a full sample session.

-----