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

infer_schema!("dontenv:DATABASE_URL") should give an error that is useful to newbies #1313

Open
sgrif opened this Issue Nov 28, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@sgrif
Member

sgrif commented Nov 28, 2017

I'm not sure exactly what the metrics should be here (maybe this issue just goes away once proc macros 2.0 is stable and this can be dotenv!("DATABASE_URL") again). But there is definitely a class of arguments here which we can be reasonably sure is an error. We should give a helpful error message here if so.

@sgrif

This comment has been minimized.

Member

sgrif commented Nov 28, 2017

Hey @nrc I know you can't say when things will be stable, but do you think it'll be long enough that we should bother dealing with this?

@sgrif sgrif changed the title from infer_schema!(dontenv:DATABASE_URL) should give an error to infer_schema!("dontenv:DATABASE_URL") should give an error that is useful to newbies Nov 28, 2017

@nrc

This comment has been minimized.

nrc commented Nov 28, 2017

I'm not really sure. In theory, there is not much work to do before we can start stabilisation (mostly making sure libraries can work, especially around hygiene). But there's no one signed up for this, so I'm not sure when it'll ever get done. I'd guess end of 2018, but it is just a guess - could be much sooner if someone jumps on it, or much longer if nobody does.

@weiznich

This comment has been minimized.

Contributor

weiznich commented Nov 28, 2017

This should be doable with our current implementation. We simply need to remove those calls to unwrap and replace them by something returning code with a meaningful error massage using compile_error!.

(Probably this should be done after #1231 is merged)

@sgrif

This comment has been minimized.

Member

sgrif commented Nov 28, 2017

@weiznich FYI -- If you press y in Github it will convert the address bar to a "canonical URL" which will continue to work even after I merge your PRs. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment