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

resources: Improve error messages when no config annotation exists or type is wrong #1386

Merged
merged 2 commits into from Jul 10, 2020

Conversation

adisbladis
Copy link
Member

No description provided.

if isinstance(config_type, str):
if config_type == "ResourceOptions":
raise TypeError(
f'{self.__class__} is missing a "config" attribute, for example: `config: nixops.resources.ResourceOptions`, see https://nixops.readthedocs.io/en/latest/plugins/authoring.html'
Copy link
Member

@cole-h cole-h Jul 10, 2020

Choose a reason for hiding this comment

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

Instead of "for example," maybe we should link to an anchor on the readthedocs page that explains the existence/necessity/usage of config: nixops.resources.ResourceOptions. Then this could become:

Suggested change
f'{self.__class__} is missing a "config" attribute, for example: `config: nixops.resources.ResourceOptions`, see https://nixops.readthedocs.io/en/latest/plugins/authoring.html'
f'{self.__class__} is missing a "config" attribute, see: https://nixops.readthedocs.io/en/latest/plugins/authoring.html#some-anchor-with-info'

As long as there is a header, it'll be easy to link to -- maybe a short blurb could go in a new bullet under the "Important Notes" section, and then we can link to https://nixops.readthedocs.io/en/latest/plugins/authoring.html#important-notes.


Note to self: I'll tackle this myself, but ixxie expressed interest in helping improve docs, so I'll wait until that's done.

Co-authored-by: Graham Christensen <graham@grahamc.com>
@adisbladis adisbladis merged commit f2ef004 into NixOS:master Jul 10, 2020
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.

None yet

3 participants