Skip to content

Commit

Permalink
chore: ehnance error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
krvital committed Aug 24, 2024
1 parent 3e7bf46 commit 0c09315
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/aidbox_sdk/cli.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
["-h" "--help"]])

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

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

(nil? input)
(conj "Please provide input argument"))))
(conj "Please provide a source of fhir packages"))))

(defn print-errors [errors]
(binding [*out* *err*]
Expand Down
9 changes: 7 additions & 2 deletions src/aidbox_sdk/schema.clj
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,15 @@
[{:keys [source]} opts]
(let [extract-link (fn [package] (-> package :href))
extract-name (fn [package] (str (:name package) "#" (:version package)))
fhir-packages (do
fhir-packages (try
(println "Downloading list of dependencies from:" source)
(-> (fetch-n-parse source opts)
(skip-root-package)))]
(skip-root-package))

(catch Exception _
(println
"ERROR: Cannot download FHIR packages. You might have provided the wrong source or forgotten to provide an authentication token.")
[]))]
(->> fhir-packages
;; TODO using pmap for side effects is questionable
(pmap (fn [package]
Expand Down

0 comments on commit 0c09315

Please sign in to comment.