mirror of
https://gitlab.com/vindarel/ciel.git
synced 2025-12-15 14:51:16 -08:00
scripts: no error handling in apipointer, it's done when running the script
This commit is contained in:
parent
69dd197eb9
commit
0feaee281b
1 changed files with 11 additions and 9 deletions
|
|
@ -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.~&")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue