From bad9d4294b8e98c2a27c0855934c3a55bc88669f Mon Sep 17 00:00:00 2001 From: Luis Pereira Date: Tue, 6 Jan 2026 11:00:17 +0000 Subject: [PATCH] fix: add api catch all route with 404 --- asteroid.lisp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/asteroid.lisp b/asteroid.lisp index 288f678..e002d8e 100644 --- a/asteroid.lisp +++ b/asteroid.lisp @@ -47,6 +47,14 @@ ;; Set JSON as the default API format (setf *default-api-format* "json") +(define-api || () () + "Defines a catch all handler for non existing API routes + Overrides default radiance definition that invokes an error condition." + (api-output `(("status" . "error") + ("message" . "It seems that you have hit an unidentified astronomical object.")) + :message "It seems that you have hit an unidentified astronomical object." + :status 404)) + ;; Recently played tracks management (defun add-recently-played (track-info &optional (stream-type :curated)) "Add a track to the recently played list (max 3 tracks).