fjage icon indicating copy to clipboard operation
fjage copied to clipboard

Errors in parameter getters / setters are not reported

Open ettersi opened this issue 3 years ago • 5 comments

The current implementation does not report errors raised in parameter getter and setters.

I believe the culprit is this generic catch clause here.

ettersi avatar Apr 21 '23 05:04 ettersi

Maybe we should log some kind of errors but not others?

notthetup avatar Apr 21 '23 06:04 notthetup

Values passed in to setters can come from users and can be meaningless in the context. If we insisted on every setter fully validating the inputs, the code would become verbose and less readable. We need a middle ground on how to handle such inputs.

The current implementation is very lax, but simply ignoring errors. The other extreme would be to log stack traces as errors. That feels alarmist and will make logs harder to work with. Perhaps we can log them as single liner warnings?

mchitre avatar Apr 21 '23 07:04 mchitre

Maybe we can ignore data conversion type errors but log other types of errors?

notthetup avatar Apr 21 '23 08:04 notthetup

I'm not following what is the link between validation and error reporting. Are we talking about conversion errors like the user passes a string when an integer is expected? Errors like these should be fairly easy to detect and ignore, like @notthetup suggested. It seems reasonable to me that anything beyond that would qualify as a programming error. Otherwise, you'd e.g. get an error message if you make a programming error in a processrequest(), but you wouldn't get one if you moved exactly the same code to a setter.

ettersi avatar Apr 21 '23 10:04 ettersi

Let's do warnings for conversion errors, and stack traces for other exceptions. And if that gets noisy in the logs then revisit why.

mchitre avatar Apr 22 '23 05:04 mchitre