Mvc: Reevaluate try/catch in input formatters

Created on 28 Jun 2016  路  9Comments  路  Source: aspnet/Mvc

Right now we have a try/catch around input formatters to allow them to throw and have us treat it as a model state error. I think we're possibly swallowing more errors than we should here, and turning them into 400s instead of 500s.

See https://github.com/aspnet/Home/issues/1605#issuecomment-229158767

The root cause of this issue was a package mismatch, but it became a model state error instead.

3 - Done breaking-change bug needs design

All 9 comments

We think the best way to fix this would be a breaking change, so putting this in the 2.x milestone.

This failed to happen during 2.0 馃槩

Then maybe it's reasonable to just close this issue?

@Eilon how is it reasonable if this change has not happen/the issue was not resolved?

@another-guy this issue has not had much attention so it seems as a relatively low priority item, especially considering that it's a breaking change, so the next time we could fix this is in the 3.0 release (we're nearly shut down in the 2.0 release). I talked to @rynowak earlier and we think we might be able to incorporate this into some future "Better Model Binding" implementation.

@Eilon makes sense. Thank you for clarification!

@Eilon - if this is for 3.0 can we close this in favor of tracking it with https://github.com/aspnet/Mvc/issues/6549?

We'll reconsider doing this in 2.1, even though it's a breaking change. We would likely add a setting to disable the new behavior in case it breaks anyone.

Was this page helpful?
0 / 5 - 0 ratings