Hi,
I have a question regarding Magritte Validation. Given the following description
descriptionAcquireRetryDelay ^ MANumberDescription new selectorAccessor: #acquireRetryDelay label: 'Aquire Retry Delay'; group: 'C3P0'; priority: 100; beRequired; beInteger; bePositive; yourself
I do have a problem if the user enters a non-number. This is IMHO caused by #bePositive which checks if a given number is positive by sending #positive.
However if the user enters "aaa" the object being validated is the String ... which does not understand #positive.
If I remove the #bePositive condition everything is find and I do get (expected) Validation Errors complaining about invalid input and non-integer.
So I'm wondering if I need to somehow specify to check the #bePositive condition (or any other condition for this case) only /after/ the correct type has been validated/determined.
Any pointers?
CU,
Udo
After digging a bit more I think the following patch fixes the issue ... not sure if it breaks anything else though:
MAKindError>>#isResumable ^ false
CU,
Udo
Udo Schneider schrieb:
Hi,
I have a question regarding Magritte Validation. Given the following description
descriptionAcquireRetryDelay ^ MANumberDescription new selectorAccessor: #acquireRetryDelay label: 'Aquire Retry Delay'; group: 'C3P0'; priority: 100; beRequired; beInteger; bePositive; yourself
I do have a problem if the user enters a non-number. This is IMHO caused by #bePositive which checks if a given number is positive by sending #positive.
However if the user enters "aaa" the object being validated is the String ... which does not understand #positive.
If I remove the #bePositive condition everything is find and I do get (expected) Validation Errors complaining about invalid input and non-integer.
So I'm wondering if I need to somehow specify to check the #bePositive condition (or any other condition for this case) only /after/ the correct type has been validated/determined.
Any pointers?
CU,
Udo
Looks like you've discovered yet another bug in exception handling.
I am looking into removing these resumable exceptions now. We should not need to use them. That's too tricky.
Lukas
2009/11/5 Udo Schneider Udo.Schneider@homeaddress.de:
After digging a bit more I think the following patch fixes the issue ... not sure if it breaks anything else though:
MAKindError>>#isResumable ^ false
CU,
Udo
Udo Schneider schrieb:
Hi,
I have a question regarding Magritte Validation. Given the following description
descriptionAcquireRetryDelay ^ MANumberDescription new selectorAccessor: #acquireRetryDelay label: 'Aquire Retry Delay'; group: 'C3P0'; priority: 100; beRequired; beInteger; bePositive; yourself
I do have a problem if the user enters a non-number. This is IMHO caused by #bePositive which checks if a given number is positive by sending #positive.
However if the user enters "aaa" the object being validated is the String ... which does not understand #positive.
If I remove the #bePositive condition everything is find and I do get (expected) Validation Errors complaining about invalid input and non-integer.
So I'm wondering if I need to somehow specify to check the #bePositive condition (or any other condition for this case) only /after/ the correct type has been validated/determined.
Any pointers?
CU,
Udo
Thanks for the information. I'll keep my KISS "fix" for the moment until you did the hard part :-) Currently the fix doesn't seem to break anything.
Best Regards,
Udo
Lukas Renggli schrieb:
Looks like you've discovered yet another bug in exception handling.
I am looking into removing these resumable exceptions now. We should not need to use them. That's too tricky.
Lukas
2009/11/5 Udo Schneider Udo.Schneider@homeaddress.de:
After digging a bit more I think the following patch fixes the issue ... not sure if it breaks anything else though:
MAKindError>>#isResumable ^ false
CU,
Udo
Udo Schneider schrieb:
Hi,
I have a question regarding Magritte Validation. Given the following description
descriptionAcquireRetryDelay ^ MANumberDescription new selectorAccessor: #acquireRetryDelay label: 'Aquire Retry Delay'; group: 'C3P0'; priority: 100; beRequired; beInteger; bePositive; yourself
I do have a problem if the user enters a non-number. This is IMHO caused by #bePositive which checks if a given number is positive by sending #positive.
However if the user enters "aaa" the object being validated is the String ... which does not understand #positive.
If I remove the #bePositive condition everything is find and I do get (expected) Validation Errors complaining about invalid input and non-integer.
So I'm wondering if I need to somehow specify to check the #bePositive condition (or any other condition for this case) only /after/ the correct type has been validated/determined.
Any pointers?
CU,
Udo
squeak-dev@lists.squeakfoundation.org