danieleteti / delphimvcframework

DMVCFramework (for short) is a popular and powerful framework for WEB API in Delphi. Supports RESTful and JSON-RPC WEB APIs development.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exceptions generated from incorrectly filling in the arguments of an endpoint are not escalated to the custom exceptions handler.

diegofgeremias opened this issue · comments

When I invoke a method from my API filling an erroneous argument, for example, the method expects an integer argument and I fill a string argument, an exception is generated as expected, but this exception is not escaleted to the custom exceptions handler that I defined in the 'SetExceptionHandler' method.

Wouldn't it be interesting that this type of exception was also 'escalated' to the personalized management of exceptions?

Example of method call to simulate the situation:

//Correct invoke
GET http://localhost:8080/api/v1/users/1

//Invoke that causes the error
GET http://localhost:8080/api/v1/users/a

As far as I could tell, the call to the 'FillActualParamsForAction' method of the 'TMVCEngine' class is surrounded by a try except, when in fact, it shouldn't.