armeria icon indicating copy to clipboard operation
armeria copied to clipboard

Consider making `ContentTooLargeException` extend `HttpStatusException`

Open ikhoon opened this issue 1 year ago • 1 comments

Suggested by @dlvenable (https://github.com/line/armeria/discussions/5565)

The ContentTooLargeException does not inherit from HttpStatusException. We currently have a block of code that handles HttpStatusException exceptions by looking to see if it is a client or server error. Can we make ContentTooLargeException inherit from HttpStatusException?

ContentTooLargeException represents 413 status so, I think, we can make ContentTooLargeException extend HttpStatusException to streamline exception handling logic.

ikhoon avatar Apr 08 '24 07:04 ikhoon

I realized that ContentTooLargeException can't simply extend HttpStatusException because HttpStatusException is in server package but ContentTooLargeException is in common.

It seems like this issue should be considered in Armeria 2.0.

ikhoon avatar Apr 22 '24 11:04 ikhoon

I believe that we don't want to make ContentTooLargeException extend HttpStatusException. See this comment: https://github.com/line/armeria/discussions/5565#discussioncomment-9056979

minwoox avatar May 22 '24 02:05 minwoox