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

Full key status report on initialization errors #3

Closed
mbj opened this issue Nov 17, 2013 · 3 comments · Fixed by #18
Closed

Full key status report on initialization errors #3

mbj opened this issue Nov 17, 2013 · 3 comments · Fixed by #18

Comments

@mbj
Copy link
Owner

mbj commented Nov 17, 2013

Currently anima's initialization error reports are weak.

  • For the first missing key an exception is raised, resulting in more debugging cycles for more missing keys.
  • If an extra key is present an exception is raised for all extra keys.
  • If a key is missing no extra keys are reported.

IMHO anima should report a "full" key-state report if ANY error condition is found. Generating the full report will result in more computation but efficiency on the error code path is not a primary objective.

@dkubb
Copy link
Collaborator

dkubb commented Nov 18, 2013

@mbj it sounds like you want an object that is responsible for validating the input attributes? You could pass in the attributes into the constructor, then call a command method to assert the keys are valid, and then call #to_hash on the result. If the keys were invalid it would raise an exception with the full error message.

@mbj
Copy link
Owner Author

mbj commented Nov 18, 2013

@dkubb I think an internal method should be enough. But I cant forsee
the implementation at all detail levels.

On Sun, Nov 17, 2013 at 04:49:07PM -0800, Dan Kubb wrote:

@mbj it sounds like you want an object that is responsible for validating the input attributes? You could pass in the attributes into the constructor, then call a command method to assert the keys are valid, and then call #to_hash on the result. If the keys were invalid it would raise an exception with the full error message.


Reply to this email directly or view it on GitHub:
#3 (comment)

Markus Schirp

Phone: +49 201 / 360 379 14
Fax: +49 201 / 360 379 16
Web: schirp-dso.com
Email: mbj@schirp-dso.com
Twitter: twitter.com/m_b_j
OS-Code: github.com/mbj

Altendorferstrasse 44
D-45127 Essen

@mbj mbj mentioned this issue Oct 20, 2014
@elskwid
Copy link

elskwid commented Oct 21, 2014

This is blocking v1.0. @mbj am I reading this correctly? You want to have the error reported as single exception that states the combined error state of any/all missing keys and extra keys. Right?

mbj added a commit that referenced this issue Aug 14, 2015
mbj added a commit that referenced this issue Aug 14, 2015
@mbj mbj closed this as completed in #18 Aug 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants