Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

neil new crashes on certain forms of invalid input #167

Closed
teodorlu opened this issue Feb 18, 2023 · 2 comments
Closed

neil new crashes on certain forms of invalid input #167

teodorlu opened this issue Feb 18, 2023 · 2 comments

Comments

@teodorlu
Copy link
Contributor

teodorlu commented Feb 18, 2023

Example below. invalid-template is not a provided built-in template - but I don't think that's easy to read from the stack trace.

$ neil new invalid-template some-gibberish
----- Error --------------------------------------------------------------------
Type:     clojure.lang.ExceptionInfo
Message:  Failed to parse :git/url
Data:     {:git/url "https://github.com/invalid-template"}
Location: /home/teodorlu/.local/bin/neil:285:7

----- Context ------------------------------------------------------------------
281:   (let [[[_ gh-user repo-name]] (or (re-seq github-repo-ssh-regex git-url)
282:                                     (re-seq github-repo-http-regex git-url))]
283:     (if (and gh-user repo-name)
284:       {:gh-user gh-user :repo-name repo-name}
285:       (throw (ex-info "Failed to parse :git/url" {:git/url git-url})))))
           ^--- Failed to parse :git/url
286:
287: (defn- git-url->lib-sym [git-url]
288:   (when-let [{:keys [gh-user repo-name]} (parse-git-url git-url)]
289:     (symbol (str "io.github." gh-user) repo-name)))
290:

----- Stack trace --------------------------------------------------------------
babashka.neil.new/parse-git-url     - /home/teodorlu/.local/bin/neil:285:7
babashka.neil.new/parse-git-url     - /home/teodorlu/.local/bin/neil:280:1
babashka.neil.new/git-url->lib-sym  - /home/teodorlu/.local/bin/neil:288:42
babashka.neil.new/git-url->lib-sym  - /home/teodorlu/.local/bin/neil:287:1
babashka.neil.new                   - /home/teodorlu/.local/bin/neil:303:57
... (run with --debug to see elided elements)
babashka.neil.new                   - /home/teodorlu/.local/bin/neil:470:18
babashka.neil/-main                 - /home/teodorlu/.local/bin/neil:1556:3
babashka.neil/-main                 - /home/teodorlu/.local/bin/neil:1555:1
babashka.neil                       - /home/teodorlu/.local/bin/neil:1616:3
babashka.neil                       - /home/teodorlu/.local/bin/neil:1615:1
@borkdude
Copy link
Contributor

borkdude commented Apr 2, 2024

Seems to be already fixed

@borkdude borkdude closed this as completed Apr 2, 2024
@teodorlu
Copy link
Contributor Author

teodorlu commented Apr 2, 2024

Thanks! 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants