Skip to content

Displaying error messages #1379

Closed Answered by johnlindquist
josephcrawfordSRH asked this question in Q&A
Discussion options

You must be logged in to vote

@josephcrawfordSRH

Error messages should be improved in the 2.0 release candidate:

https://github.com/johnlindquist/kitapp/releases/tag/v1.99.79

(Using "grit" instead of "git" for testing purposes)

let hasGrit = await isBin("grit")
if (hasGrit) {
  // Do grit stuff
} else {
  throw Error("You need to install grit")
}

Or if you want to provide much more info:

let hasGrit = await isBin("grit")
if (hasGrit) {
  // Do grit stuff
} else {
  let message = md(`# Grit Not Found
    
The \`grit\` command was not found on your PATH accessible in this script.

Please check \`grit\` is installed.

Options:
- Add PATH variable in ~/.kenv/.env
- Modify this script to use the full path to \`grit\`

Clic…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@josephcrawfordSRH
Comment options

Answer selected by josephcrawfordSRH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants