Skip to content

Commit

Permalink
Better error reporting. Audio source handle
Browse files Browse the repository at this point in the history
  • Loading branch information
borodust committed Dec 9, 2016
1 parent dd44cdc commit f2929e2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
7 changes: 6 additions & 1 deletion audio/source.lisp
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
(in-package :cl-bodge.audio)


(defhandle audio-source-handle
:initform (al:gen-source)
:closeform (al:delete-source *handle-value*))


(defclass audio-source (al-object) ()
(:default-initargs :id (al:gen-source)))
(:default-initargs :handle (make-audio-source-handle)))


(define-system-function make-audio-source audio-system (&key (system *system*))
Expand Down
2 changes: 1 addition & 1 deletion cl-bodge.asd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
:author "Pavel Korolev"
:mailto "dev@borodust.org"
:license "MIT"
:depends-on (alexandria log4cl local-time)
:depends-on (alexandria log4cl local-time dissect)
:pathname "utils"
:serial t
:components ((:file "packages")
Expand Down
7 changes: 5 additions & 2 deletions utils/utils.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@
(with-gensyms (name)
`(block ,name
(handler-bind ((t (lambda (e)
(log:error "Unhandled error: ~a" e)
(return-from ,name))))
(let ((error-text (with-output-to-string (stream)
(format stream "Unhandled error:~%")
(dissect:present e stream))))
(log:error "~a" error-text)
(return-from ,name)))))
(progn ,@body)))))


Expand Down

0 comments on commit f2929e2

Please sign in to comment.