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

Incorporation of links into error messages #730

Open
VisLab opened this issue Aug 7, 2023 · 6 comments
Open

Incorporation of links into error messages #730

VisLab opened this issue Aug 7, 2023 · 6 comments

Comments

@VisLab
Copy link
Member

VisLab commented Aug 7, 2023

To facilitate putting links to the appropriate section of the specification in the error messages, I have added a file:

hed_error_codes.json in the specification.

which I assume both the Python and JavaScript tools would store internally (not look up on the web).

The idea is that when creating an error message for display, if the error code is listed in this file, the error message would contain a link.

Example:
An error with code: HED_WIKI_SEPARATOR_INVALID and message: "Required section separator 'EndSchema' not found in file" would display as:

HED_WIKI_SEPARATOR_INVALID: Required section separator 'EndSchema' not found in file.

@IanCa @happy5214

@IanCa
Copy link
Member

IanCa commented Aug 7, 2023

I agree on directly including it. Alternatively could potentially try to have the hedtools installer pull it from hed-specification when we compile the installer, but that seems like it might get messy to me, especially for hed developer environments.

What format for output are you thinking that supports inline linking? Just converting to some kind of restructured text after/instead of the current text printing?

eg:
HED_WIKI_SEPARATOR_INVALID <https://hed-specification.readthedocs.io/en/latest/Appendix_B.html#wiki-separator-invalid>_: Required section separator 'EndSchema' not found in file.

@VisLab
Copy link
Member Author

VisLab commented Aug 8, 2023 via email

@VisLab
Copy link
Member Author

VisLab commented Aug 8, 2023 via email

@IanCa
Copy link
Member

IanCa commented Aug 8, 2023

HTML would work...I have no strong opinion as I'm usually looking at these errors in pycharm

@VisLab
Copy link
Member Author

VisLab commented Aug 8, 2023

I think we should just go with a raw text reference at the end of the message with a See...

@VisLab
Copy link
Member Author

VisLab commented May 15, 2024

get_printable_issue_string now as a show link
get_printable_issue_string_html always shows the link. Currently the showing the link is not used --- should it be in the web code?

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