Skip to content

A peer-to-peer stack for code collaboration

Show message when doc not found instad of throwing

Thomas Scholtes0c5f344217bf
diff --git a/rad/prelude/doc.rad b/rad/prelude/doc.rad
index 6bb114c..8cb2b8b 100644
--- a/rad/prelude/doc.rad
+++ b/rad/prelude/doc.rad
@@ -16,10 +16,12 @@
(def doc
(fn [name]
(def the-doc (lookup name (read-ref _doc-ref)))
- (string-append
- (lookup :desc the-doc)
- "\nArguments:\n\t"
- (show (lookup :args the-doc)))))
+ (if (eq? the-doc '())
+ (string-append "No documentation found for " (show name))
+ (string-append
+ (lookup :desc the-doc)
+ "\nArguments:\n\t"
+ (show (lookup :args the-doc))))))
(document 'doc
'(("name" atom))