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

Add some documentation about common compiler error message types that users can encounter if something goes wrong #3556

Merged
merged 2 commits into from
Mar 24, 2023

Conversation

weiznich
Copy link
Member

There are a few quite common error cases that generate large complicated looking messages, but that are quite easy to break down if the error message does not scare you away. This documentation section tries to give users a potential starting point where they need to look for the issue that causes the error message.

@weiznich weiznich requested a review from a team March 21, 2023 16:12
Copy link
Contributor

@chusteven chusteven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me! Some nits on grammar, but otherwise I think this was a fantastic idea. One question, though: where will this appear? Like... I imagine a lot of ppl show up in the issues page or gitter and ask about "what does this scary compiler message mean?" and you'll have to redirect them to this file.

Is there a way to get ahead of these questions? Like... being in lib.rs does that mean it will show up on the home page of the docs for diesel here? Or just generally wondering how ppl will even know that this documentation exists

diesel/src/lib.rs Outdated Show resolved Hide resolved
diesel/src/lib.rs Outdated Show resolved Hide resolved
diesel/src/lib.rs Outdated Show resolved Hide resolved
diesel/src/lib.rs Outdated Show resolved Hide resolved
Comment on lines +109 to +110
//! Consider using [`#[derive(Selectable)]`](derive@crate::prelude::Selectable) +
//! `#[diesel(check_for_backend(diesel::pg::Pg))]`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What value does using these macros provide?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

value in terms of diesel::pg::Pg? In that case it accepts a list of diesel backend types that are used for checking.
value in terms of improvements: It generates additional code that improves the compiler error message by pointing the the relevant field of the mismatch. See #3359 for details

diesel/src/lib.rs Outdated Show resolved Hide resolved
diesel/src/lib.rs Outdated Show resolved Hide resolved
@weiznich
Copy link
Member Author

Thanks for the review and the suggestions 👍. Will include that later in the PR.

Like... I imagine a lot of ppl show up in the issues page or gitter and ask about "what does this scary compiler message mean?" and you'll have to redirect them to this file.

Is there a way to get ahead of these questions? Like... being in lib.rs does that mean it will show up on the home page of the docs for diesel here? Or just generally wondering how ppl will even know that this documentation exists

This will appear in the API documentation in basically the linked location (just above the feature flag section). Additionally it might be a good idea to put a FAQ section into the readme and/or the web page that links this section (and others that answer other commonly questions).

@chusteven
Copy link
Contributor

This will appear in the API documentation in basically the linked location (just above the feature flag section). Additionally it might be a good idea to put a FAQ section into the readme and/or the web page that links this section (and others that answer other commonly questions).

Ah I see it'll show up on this page: https://docs.rs/diesel/latest/diesel/

I think including it in a FAQ section in the README and the web page is a decent idea, but probably not worth going too crazy before we actually see lots and lots of ppl asking about it :P

@weiznich weiznich enabled auto-merge March 24, 2023 07:39
@weiznich weiznich force-pushed the docs/how_to_read_error_messages branch from a0a5ed8 to 5dad3d5 Compare March 24, 2023 08:10
Co-authored-by: Steven Chu <stevenc1@gmail.com>
@weiznich weiznich force-pushed the docs/how_to_read_error_messages branch from 5dad3d5 to 87b8977 Compare March 24, 2023 08:34
@weiznich weiznich added this pull request to the merge queue Mar 24, 2023
Merged via the queue into diesel-rs:master with commit dba9953 Mar 24, 2023
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