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

Space.Error should have field of type Object for encapsulation of erroneous data #42

Open
darko-mijic opened this issue Jan 4, 2016 · 3 comments
Assignees

Comments

@darko-mijic
Copy link
Member

I think Space.Error needs a built in field of type Object to support encapsulation of invalid data.

For i18n purposes name of the error class instance + data that is wrong (causing the error) can be enough to generate language specific error message.

I suggest adding something like this to default fields of Space.Error:
data: Match.Optional(Object)

Maybe the name of this field is not ideal.

What do you think @rhyslbw and @DominikGuzei?

@DominikGuzei
Copy link
Member

Hmm … the question is, is it necessary to add a general purpose field when you can just add it to any custom error type? Then you can also have more specific field names that make sense in the context.

@rhyslbw
Copy link
Member

rhyslbw commented Jan 23, 2016

@darko-mijic All up for standardising fields, maybe even as optional, but not keen on generic objects. What are the specific properties of these proposed 'data' objects?

@darko-mijic
Copy link
Member Author

My idea was to have optional object that will contain relevant data that caused the error. I was adding that to almost all my subclasses of Space.Error (my custom error types). So the error presented to the client would include i18n message + data from the proposed field.

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

No branches or pull requests

3 participants