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

Allow Exception object in _error struct. #900

Merged
merged 2 commits into from Dec 11, 2014

Conversation

Projects
None yet
2 participants
@aka-demik
Contributor

aka-demik commented Nov 20, 2014

Hi.
I tried to do something like:

struct ErrInfo
{
    Exception error;
    string field;
}
void getList(ErrInfo _error) {...}
@errorDisplay!getList
void postNew() {...}

ErrorDisplayAttribute.getError allow fill Exception object in _error struct.
But if there is no error information, HandleRequest trying to read _error from req.params.
And it fails because webConvTo can not handle this struct.
This pull request fixes this. But now _error not be read from req.params at all. And now _error can not have default value.
I think that the _error parameter is enough internally, to behave this way. But I'm not entirely sure.
Thanks!

@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig Dec 11, 2014

Member

Definitely makes sense. I'll merge and then see if it broke any of my projects, but it looks like it should be fine.

Member

s-ludwig commented Dec 11, 2014

Definitely makes sense. I'll merge and then see if it broke any of my projects, but it looks like it should be fine.

s-ludwig added a commit that referenced this pull request Dec 11, 2014

Merge pull request #900 from aka-demik/master
Don't try to source _error parameters from req.params.

@s-ludwig s-ludwig merged commit 95bef7d into vibe-d:master Dec 11, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment