Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Edited Issue: Logging tracing information when OData routing is failed [822]

$
0
0
Scenario: when user requests a odata action url with GET http method, which is wrong in in odata spec, the error message returns back from server doesn't show specific error. It shows:
{
"odata.error":{
"code":"","message":{
"lang":"en-US","value":"No HTTP resource was found that matches the request URI 'http://localhost:1918/odata/Users(1)/GetCorrectAnswerCount'."
},"innererror":{
"message":"No routing convention was found to select an action for the OData path with template '~/entityset/key/action'.","type":"","stacktrace":""
}
}
}

I expect that it should tell me that GET is not allowed for odata action.

The reason why the error is too generic is because we fallback to next convention if it doesn't match with current convention and we throw when no convention matches. At the time we throw, we lose the specific information about what's wrong.

The possible solution is to have a logger to log errors or warnings in conventions and report it to tracing or client if no convention is found.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>