From c60b7b34759f866549752a97a83c12f04f8a903e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 27 Jul 2020 00:06:31 +0200 Subject: Crash properly on overflow on remove event. --- module/entry-points/server.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'module/entry-points/server.scm') diff --git a/module/entry-points/server.scm b/module/entry-points/server.scm index 711119e4..5c3108cc 100644 --- a/module/entry-points/server.scm +++ b/module/entry-points/server.scm @@ -117,12 +117,16 @@ ;; It's hard to properly remove a file. I also want a way to undo accidental ;; deletions. Therefore I simply save the X-HNH-REMOVED flag to the file, and ;; then simple don't use those events when loading. + (catch 'stack-overflow (lambda () (remove-event it)) + (lambda _ + (display "It overflew...\n" (current-error-port)) + (return (build-response code: 500) + "It overflew again..."))) (set! (prop it 'X-HNH-REMOVED) #t) (set! (param (prop* it 'X-HNH-REMOVED) 'VALUE) "BOOLEAN") (unless ((@ (output vdir) save-event) it) (return (build-response code: 500) "Saving event to disk failed.")) - (remove-event it) (return (build-response code: 204) "")) (return (build-response code: 400) (format #f "No event with UID '~a'" uid)))) -- cgit v1.2.3