[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Error with WITH-HANDLER+UNIT?




This code fragment catches an error and returns it:

> (with-handlers
    ((identity identity))
     (/ 1 0))
#<struct:exn:application:divide-by-zero>

But this doesn't catch the error UNIT throws

> (with-handlers
    ((identity identity))
     (unit (import) (export) some-unknown-variable))

unit: used an unbound or non-primitive global in: some-unknown-variable

Similarly,

(ignore-errors (lambda () (unit (import) (export)
some-unknown-variable)))
unit: used an unbound or non-primitive global in: some-unknown-variable

Is this a bug, or am I misunderstanding something?