scripts: no error handling in apipointer, it's done when running the script

This commit is contained in:
vindarel 2023-03-11 19:17:59 +01:00
parent 69dd197eb9
commit 0feaee281b

View file

@ -13,16 +13,18 @@
(import 'arrow-macros:-<>)
(import 'arrow-macros:<>)
;;; For the example sake, we don't do error handling in (main),
;;; because when the script is run, CIEL adds a handler-case to handle
;;; any error and print a short message, sans the stacktrace.
;;; Proper error handling is left as an exercise to the reader.
(defun main (url pointer)
(handler-case
(-<> url
dex:get
json:read-json
(json-pointer:get-by <> pointer)
;; for a terminal output:
pprint)
(error (c)
(format *error-output* "An error occured: ~a~&" c))))
(-<> url
dex:get
json:read-json
(json-pointer:get-by <> pointer)
;; for a terminal output:
pprint))
(unless (second uiop:*command-line-arguments*)
(format! t "APIPointer: request a JSON API, get nested elements with json-pointer.~&")