Skip to content

Adding custom mapper for json processing exception#2264

Merged
xvrl merged 1 commit intoapache:masterfrom
himank:CustomExceptionMapper
Jan 22, 2016
Merged

Adding custom mapper for json processing exception#2264
xvrl merged 1 commit intoapache:masterfrom
himank:CustomExceptionMapper

Conversation

@himank
Copy link
Copy Markdown

@himank himank commented Jan 14, 2016

Custom exception mapper to return bad request instead of returning 500.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

missing newline

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I'll add it thanks

@himank himank force-pushed the CustomExceptionMapper branch 2 times, most recently from 85585de to 2cb0631 Compare January 14, 2016 20:35
@himank
Copy link
Copy Markdown
Author

himank commented Jan 14, 2016

Updated the pull request with customizing JsonMappingException instead of JsonProcessingException as the former one is more appropriate for problems related to mapping content. Before/After output is below.

https://gist.github.com/himank/2bf076ab0b3b5c93c038

@fjy
Copy link
Copy Markdown
Contributor

fjy commented Jan 15, 2016

Thanks for the contrib @himank. Will try to review shortly

@himank
Copy link
Copy Markdown
Author

himank commented Jan 16, 2016

@fjy Thanks :)

@himank
Copy link
Copy Markdown
Author

himank commented Jan 20, 2016

@fjy If you get chance could you please review it, Thanks in advance.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

other places use "error" lower case

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

also should probably be exception.getMessage() == null ? "unknown json mapping exception" : exception.getMessage() or similar

@drcrallen
Copy link
Copy Markdown
Contributor

👍 after minor comments

@drcrallen
Copy link
Copy Markdown
Contributor

Thanks for the contrib @himank . Could you please fill out the CLA at http://druid.io/community/cla.html ?

@himank himank force-pushed the CustomExceptionMapper branch from 2cb0631 to 1a5d4e7 Compare January 22, 2016 17:49
@himank
Copy link
Copy Markdown
Author

himank commented Jan 22, 2016

@drcrallen Thanks for the review, updated as per your comments. Please review when you get chance :)

@fjy
Copy link
Copy Markdown
Contributor

fjy commented Jan 22, 2016

👍

xvrl added a commit that referenced this pull request Jan 22, 2016
Adding custom mapper for json processing exception
@xvrl xvrl merged commit 789b35a into apache:master Jan 22, 2016
@fjy
Copy link
Copy Markdown
Contributor

fjy commented Jan 23, 2016

@himank do you mind following the steps here? https://groups.google.com/forum/#!topic/druid-development/1Zs3Vd9LHCQ so your contribution will be counted :)

@fjy fjy added this to the 0.9.0 milestone Feb 4, 2016
@fjy fjy mentioned this pull request Feb 5, 2016
@fjy fjy added the Feature label Feb 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants