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

fix: improve error handling to catch syntax errors #454

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

kkweon
Copy link
Contributor

@kkweon kkweon commented Nov 22, 2024

  • Updated bin/verify-exercises.sh to use --on-error=status for better error handling. The default behavior was to print a message and to return a success status.

Now, it catches a syntax error and shows the following output:

The following exercises failed:
exercises/practice/acronym/.meta/acronym.example.pl

Context

I read this

which leads to

The above suggests that it can use --on-error=status to get the exit status of the program.

- Updated `bin/verify-exercises.sh` to use `--on-error=status` for better error handling. The default behavior was to print a message and to return a success status.

Now, it catches a syntax error and shows the following output:

```shell
The following exercises failed:
exercises/practice/acronym/.meta/acronym.example.pl
```

Context
-------

I read this
- https://swi-prolog.discourse.group/t/automatic-tests-can-succeed-with-syntax-errors/3891/10

which leads to
- https://swi-prolog.discourse.group/t/changes-in-error-handling/3930

The above suggests that the behavior of `swipl` has changed and that we should
use `--on-error=status` to get the exit status of the program.
Copy link

Hello. Thanks for opening a PR on Exercism 🙂

We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in.

You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch.

If you're interested in learning more about this auto-responder, please read this blog post.


Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it.

@github-actions github-actions bot closed this Nov 22, 2024
@ErikSchierboom ErikSchierboom merged commit 5dd4784 into exercism:main Nov 22, 2024
6 checks passed
@ErikSchierboom
Copy link
Member

Thanks a lot!

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

Successfully merging this pull request may close these issues.

2 participants