orthecreedence / blackbird

Common Lisp promise implementation (successor to cl-async-future)
83 stars 10 forks source link

does (push :future-debug *features*) still work? #13

Closed nightshade427 closed 9 years ago

nightshade427 commented 9 years ago

does (push :future-debug features) still work?

nightshade427 commented 9 years ago

Im just going to switch to blackbird completly instead of using cl-async-future. Will let you know how it goes.

orthecreedence commented 9 years ago

No, there have been some (undocumented) changes pushed the past few days wrt error handling. The new (and better, because it doesn't actually trap errors at all, giving you full stack traces) is blackbird:*debug-on-error*. When set to t (nil is the default) it allows any errors that occur in a promise form to bubble up to the top-level without being caught or rethrown by blackbird.

Consider these two:

(catcher
  (attach (+ 4 'five)
    (lambda (x) (format t "x is ~a~%" x)))
  (error (e) (format t "err! ~a~%" e)))

This will print "err! <type error blah blah>".

(let ((blackbird:*debug-on-error* t))
  (catcher
    (attach (+ 4 'five)
      (lambda (x) (format t "x is ~a~%" x)))
    (error (e) (format t "err! ~a~%" e))))

This will throw the error into the debugger, giving the full backtrace (and as of a few minutes ago, the ability to reject the promise and continue processing the chain via the blackbird-base:reject-promise restart).