Skip to content

Commit 0c09315

Browse files
committed
chore: ehnance error messages
1 parent 3e7bf46 commit 0c09315

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/aidbox_sdk/cli.clj

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
["-h" "--help"]])
1414

1515
(def supported-commands #{"generate"})
16-
(def supported-languages #{"dotnet" "java" "typescript" "python"})
16+
(def supported-languages #{"dotnet"})
1717

1818
(defn validate-args [args]
1919
(let [[command target-language input] args]
@@ -27,7 +27,7 @@
2727
(str/join ", " supported-languages)))
2828

2929
(nil? input)
30-
(conj "Please provide input argument"))))
30+
(conj "Please provide a source of fhir packages"))))
3131

3232
(defn print-errors [errors]
3333
(binding [*out* *err*]

src/aidbox_sdk/schema.clj

+7-2
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,15 @@
107107
[{:keys [source]} opts]
108108
(let [extract-link (fn [package] (-> package :href))
109109
extract-name (fn [package] (str (:name package) "#" (:version package)))
110-
fhir-packages (do
110+
fhir-packages (try
111111
(println "Downloading list of dependencies from:" source)
112112
(-> (fetch-n-parse source opts)
113-
(skip-root-package)))]
113+
(skip-root-package))
114+
115+
(catch Exception _
116+
(println
117+
"ERROR: Cannot download FHIR packages. You might have provided the wrong source or forgotten to provide an authentication token.")
118+
[]))]
114119
(->> fhir-packages
115120
;; TODO using pmap for side effects is questionable
116121
(pmap (fn [package]

0 commit comments

Comments
 (0)