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

docs: align errors and warning docs #5142

Closed
2 tasks done
giuliowaitforitdavide opened this issue Nov 4, 2023 · 9 comments · Fixed by #5162
Closed
2 tasks done

docs: align errors and warning docs #5142

giuliowaitforitdavide opened this issue Nov 4, 2023 · 9 comments · Fixed by #5162

Comments

@giuliowaitforitdavide
Copy link
Contributor

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

Recently we added the docs/Reference/Warnings.md to better document all the warnings emitted by Fastify. To do that, we used tables in the format

Code Description How to solve Discussion

In the docs/Reference/Errors.md instead we list all the errors with a short description.
What do you think about aligning the style of the two pages by using a similar table for the errors? Maybe it could not be possible to write the How to solve column for all of the errors, but it could make the page more readable.

@Uzlopak
Copy link
Contributor

Uzlopak commented Nov 4, 2023

I am -1 for this.

@jsumners
Copy link
Member

jsumners commented Nov 9, 2023

I think the current doc is mirroring https://nodejs.org/dist/latest-v20.x/docs/api/errors.html#nodejs-error-codes

The difference is we don't have an in-page table-of-contents like they do. See top of https://nodejs.org/dist/latest-v20.x/docs/api/errors.html

I'm really not sure what would be better. An example shown here would help.

@giuliowaitforitdavide
Copy link
Contributor Author

@jsumners you mean an example of what I'm proposing?
Because, for example, I was thinking of something like that

Code Description How to solve Discussion
FST_ERR_NOT_FOUND 404 not found - #2339

I like the idea of mirroring nodejs-error-codes, but I don't think it's a constraint to be strictly followed: I'm quite sure a table representation would improve readability a lot.
Also the solution you propose seems like a nice solution to me (in-page table-of-contents like the top of the nodejs doc you sent), but I suggest to align also the warning page we wrote here to have a uniform style.

@Uzlopak
Copy link
Contributor

Uzlopak commented Nov 11, 2023

I dislike the idea of a table structure.

@Uzlopak
Copy link
Contributor

Uzlopak commented Nov 11, 2023

And if we have to link to a discussion/issue then the documentation wont be self contained.

@jsumners
Copy link
Member

I'm good with the suggestion. It would make things more legible. But each row should have an anchor so that errors can easily be linked.

@fastify/core ?

@Eomm
Copy link
Member

Eomm commented Nov 12, 2023

I think a link does not hurt and Google+SEO will help someone during the debug

@metcoder95
Copy link
Member

Structure LGTM, just wondering about what are the exact intentions with the Discussion column?
It is to point to the rationale or what exactly?

@giuliowaitforitdavide
Copy link
Contributor Author

Structure LGTM, just wondering about what are the exact intentions with the Discussion column? It is to point to the rationale or what exactly?

I was thinking to add the PR in which we add that specific error 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

Successfully merging a pull request may close this issue.

5 participants