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

Recover from errors #63

Open
abitrolly opened this issue Jun 2, 2024 · 0 comments
Open

Recover from errors #63

abitrolly opened this issue Jun 2, 2024 · 0 comments

Comments

@abitrolly
Copy link

abitrolly commented Jun 2, 2024

When gorilla fails to provide a correct answer, as in #62, I want to it to iterate on the error to fix its mistake.

Given the failure from #62.

~ gorilla how many terminal commands I execute each day on average   
🦍  history | awk '{print $2}' | sort | uniq -c | sort -rn | awk '{ total += $1; count++ } END { print total/count }'
awk: cmd. line:1: fatal: division by zero attempted

What I want to see is it catching non-zero exit code, then reasoning a bit what happened, and proposing to run more commands to (finally) resolve the problem (and learn for the future).

<expletive>, looks like the command had failed. Let me try to figure out why it could happen.
1. The division by zero is most likely caused by `count` being 0 in `print total/count` expression
2. The count is zero when `awk` ...
3. This is most likely caused by ...
4. Which is caused by ...
5. Which is caused by `history` not returning expected sequence
I expect `history` to return data in this format.
 
10090  ldd ocp
10091  ldd `which ocp`
10092  which node

Do you want me to run `history` inspect if it works as expected? (Y/n)
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

1 participant