summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2023-03-25 15:15:05 -0400
committerDavid Thompson <dthompson2@worcester.edu>2023-03-25 15:15:05 -0400
commitd0db8e04dd5cd4466d534d4e2f71439e27b73bee (patch)
treec7bd7c10dd9a4e6140d2b2cd6e24b2be3280877f
parentc361695dab9869566fe9b7c60ca0a8bf76f987ef (diff)
pixbuf: Use proper exception objects.
-rw-r--r--chickadee/pixbuf.scm12
1 files changed, 11 insertions, 1 deletions
diff --git a/chickadee/pixbuf.scm b/chickadee/pixbuf.scm
index 09db6ee..61af06f 100644
--- a/chickadee/pixbuf.scm
+++ b/chickadee/pixbuf.scm
@@ -24,6 +24,7 @@
(define-module (chickadee pixbuf)
#:use-module (chickadee graphics color)
#:use-module (chickadee utils)
+ #:use-module (ice-9 exceptions)
#:use-module (rnrs bytevectors)
#:use-module (srfi srfi-9)
#:use-module (srfi srfi-9 gnu)
@@ -40,8 +41,17 @@
pixbuf-flip-vertically!
pixbuf-color-key!))
+(define &pixbuf-error
+ (make-exception-type '&pixbuf-error &error '()))
+
+(define make-pixbuf-error (record-constructor &pixbuf-error))
+
(define (pixbuf-error message irritants)
- (error 'pixbuff-error message irritants))
+ (raise-exception
+ (make-exception
+ (make-pixbuf-error)
+ (make-exception-with-message message)
+ (make-exception-with-irritants irritants))))
;; A pixbuf is raw pixel data stored in memory that can be saved to
;; disk or loaded into a GPU texture.