Skip to content

Machine Readable File Describing Error Codes #25425

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

Closed
Havvy opened this issue May 15, 2015 · 7 comments
Closed

Machine Readable File Describing Error Codes #25425

Havvy opened this issue May 15, 2015 · 7 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@Havvy
Copy link
Contributor

Havvy commented May 15, 2015

I'm the author of rustbot on Moznet, and I'm adding an !error <code> command. I figured that if there was an easy way to get a summary of the error, I'd post the error summary and a link to the full description, but there's no machine readable (e.g., JSON or TOML) description of the error codes. As I cannot be the only person who might find such a thing useful (e.g. IDEs), I'm filing this issue requesting that such a machine readable file be made when making rustc's documentation.

{
    "E0001": {
        "name": "Dead Match Arm",
        "summary": "An expression arm corresponding to a noted pattern will never be reached.",
        "description": "This error suggests that the expression arm corresponding to the noted pattern will never be reached as for all possible values of the expression being matched, one of the preceding patterns will match.\nThis means that perhaps some of the preceding patterns are too general, this one is too specific or the ordering is incorrect."
    },

    "...." : {}
}

A question that has to be asked is what the keys will be. Will it be "E1" or "E0001" or something else? Also, how will code examples in the description be handled, e.g. E0007?


As a side note, having a name and summary for each error would also help tremendously. Right now it's just a numeric code and a full description. I included them in the above example JSON file. Otherwise, it'd just be an object with just a description property.

@huonw
Copy link
Member

huonw commented May 15, 2015

There is JSON output: #24884

@Havvy
Copy link
Contributor Author

Havvy commented May 15, 2015

Ah, I asked @steveklabnik on IRC and he said there wasn't.

Is this JSON file accessible online somewhere? [I asked @huonw on IRC and he doesn't know.]

Havvy added a commit to Havvy/tennu-rust-help that referenced this issue May 15, 2015
For now, it only provides a link to the error code, but with
more information, it could easily provide more information.

See also, rust-lang/rust#25425
@Havvy
Copy link
Contributor Author

Havvy commented May 18, 2015

It looks like the environmental variable ERROR_METADATA_VAR is not set, the JSON file gets deleted. Is this variable set for the build that rust-lang's documentation is built from?

@steveklabnik steveklabnik added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label May 21, 2015
@steveklabnik
Copy link
Member

Triage: lots of changes in errors, we might be moving away from codes? I think @jonathandturner told me that. Anyway, this is still a valid ticket.

@sophiajt
Copy link
Contributor

We're keeping error codes for now, we're just thinking of moving away of using them in --explain in the future, and instead having an expanded error format that uses the actual code the user wrote.

@Mark-Simulacrum
Copy link
Member

To my knowledge we've not yet changed anything here. Arguably, this is also relevant for discussion elsewhere that wants to rewrite long error diagnostic extraction to take a different approach.

@Havvy
Copy link
Contributor Author

Havvy commented Nov 12, 2017

Since this is an enhancement that nobody is going to be working on in the near to medium term, I'm going to close it.

@Havvy Havvy closed this as completed Nov 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

5 participants