Uncaught .Get() - Info #719
Replies: 2 comments 4 replies
-
I am not sure I fully understand your idea. Are you talking about validating that the parameters passed into |
Beta Was this translation helpful? Give feedback.
-
Just to give a better code sample. Customer.Get('FUBAR'); This will throw an error in most BC systems I hope, but nothing in VSC cares about it (other than the literal). However, from a UX side, if something is wrong there, it gives no opportunity for a user to 'do anything' other than try to interpret the base command. I'd like the rule to notice that call so I can then require more code like DummyVar := 'FUBAR';
if Customer.Get(DummyVar) then begin
...
end else
EmitErrorInfo(CustomerNotFound,DummyVar); And my emit error info could be a collectible or maybe an error with a Custom Action, etc. Something to encourage 'help the user out'. |
Beta Was this translation helpful? Give feedback.
-
Many times a .Get(), you WANT the program to halt, so you don't catch the error and let the platform deal with it.
But, I know a LOT of my insidious bugs I've run into over the years have just been .Get() calls where the passed param wasn't right. the .Get() failure by the platform doesn't adhere to the newer way of elevating to the user what they can do about the situation.
Could it be an idea to watch for .Get() calls that aren't wrapped with
if .Get() then
handling (etc)?I'm also thinking this is potentially annoying, so my thinking was an Info level only to start.
Beta Was this translation helpful? Give feedback.
All reactions