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

Message for errors inside stdlib? #76

Open
jvdp1 opened this issue Jan 4, 2020 · 2 comments
Open

Message for errors inside stdlib? #76

jvdp1 opened this issue Jan 4, 2020 · 2 comments
Labels
implementation Implementation in experimental and submission of a PR meta Related to this repository

Comments

@jvdp1
Copy link
Member

jvdp1 commented Jan 4, 2020

In stdlib_experimental_error.f90, there is the following example:
call error_stop("Invalid argument")
A similar case can be found in stdlib_experimental_io.f90.

When running a large program, messages such as "Invalid argument" are quite useless. Should we discuss and agree on a good way to mention error messages, e.g.,

ERROR (_name_of_the_function_): Invalid argument (_argument_)

@zbeekman
Copy link
Member

zbeekman commented Jan 6, 2020

The best way I've ever found to get good error messages and be able to do so even when using elemental or pure procedures is to define an error_stack_t class with a bunch of pure methods for pushing, popping, signalling (raising?) and then non-pure methods to catch and handle the errors.

I opened #95 to get more feedback. It could be used for the purpose described in this issue.

@certik
Copy link
Member

certik commented Jan 6, 2020

A minimal improvement is to at least list the name of the function in the error message as @jvdp1 suggested. Ideally the compiler would be able to optionally generate a nice stacktrace when the program ends with a non-zero exit code.

@awvwgk awvwgk added implementation Implementation in experimental and submission of a PR meta Related to this repository labels Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
implementation Implementation in experimental and submission of a PR meta Related to this repository
Projects
None yet
Development

No branches or pull requests

4 participants