Open heuermh opened 7 years ago
I'm currently looking into this as part of the DaSH in Heidelberg but I am very unsure about the best way to solve this.
We caught missing REST parameters in FeatureResource
by catching the error and wrapping it with our UserInputException
. Which then gets mapped to 400
errors.
Throwing a UserInputException
from the library code (FeatureServiceImpl
and FeatureServiceJbdi
) doesn't sound correct and neither does checking the actual content of the parameters in FeatureResource
.
The options I see are the following:
ApiException
(or other appropriate name) in service
, next to DnaAlphabet
and throwing that from the classes above, then catching it in FeatureResource
and warpping it in UserInputException
ApiException
(or other appropriate name) in service
and adding another eception mapper for that exception.@heuermh Which solution would be your preffered one?
It appears that
UserInputExceptionMapper
is registeredbut is not used when
IllegalArgumentException
s are thrown