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

Customize the macro error message based on the metadata #2769

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

Nemo157
Copy link
Contributor

@Nemo157 Nemo157 commented Sep 20, 2023

fixes #2767

Copy link
Collaborator

@abonander abonander left a comment

Choose a reason for hiding this comment

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

In the case of SQLX_OFFLINE=true, the wording is rather confusing.

I'd prefer something like:

Offline mode is forced on because SQLX_OFFLINE=true is set in the environment variables, but there is no cached data for this query. Please run cargo sqlx prepare to update the offline query data cache, or unset SQLX_OFFLINE.

@Nemo157
Copy link
Contributor Author

Nemo157 commented Oct 3, 2023

I reduced the start of the message a bit, if someone has explicitly set SQLX_OFFLINE I assume they know what it is. I also reduced the variation in messages that I'd added, now it's simply one message for offline and one for online-without-database-url.

@abonander abonander merged commit 080d57a into launchbadge:main Oct 17, 2023
64 checks passed
@Nemo157 Nemo157 deleted the macro-error-metadata branch October 17, 2023 23:46
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.

Wrong proc-macro error message when prepared files are out of date in offline mode
2 participants