AbtDateParser>>getMsg: prefixes errorText

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

AbtDateParser>>getMsg: prefixes errorText

Postby jtuchel » Thu Jul 16, 2009 12:46 am

Hi there,

I am working on a little Seaside-framework that uses AbtConverter and friends to convert and/or validate input in order to enable reuse of existing VAST Code.

My problem is more a cosmetic one, but annoying:

When I use a converter's displayToObject: method and the conversion returns a conversion error, I get an errorText which is prefixed with the MRI group.

For example: An AbtDateConverter returns an AbtConverterError with an errorText like

'Abt.Nls.104.e: Invalid date format.'

I'd like to display the errorText on the Web form, but without the Prefix ''Abt.Nls.104.e:'. I could simply cut off the begining of the text up to a sequence of $:$ , but that's neither a "nice" solution nor guarantueed to work with custom AbtConverter subclasses that don't use NLS for their error messages. These custom converters could retunr a text like 'Not a valid customer number: 12A34'. I'd cut off important info then.

Is there a nicer way of getting to the resulting error message of using a converter?
I currently do something like:

[self input: (cvtr objectToDisplay: self object )]
when: ExError
do: [:err| self addError: err argument printString. err exitWith: nil].


Any pointers?

Kind regards and thanks for reading

Joachim
jtuchel
[|]
 
Posts: 245
Joined: Fri Oct 05, 2007 1:05 am
Location: Ludwigsburg, Germany

Re: AbtDateParser>>getMsg: prefixes errorText

Postby jtuchel » Thu Jul 16, 2009 10:44 pm

Maybe I should rephrase my question:

Is there a way to use an AbtContainer subclass in a way such that potential error messages are not prefixed by their MRI group, e.g. "Abt.Nls.104.e:"?

Thanks

Joachim
jtuchel
[|]
 
Posts: 245
Joined: Fri Oct 05, 2007 1:05 am
Location: Ludwigsburg, Germany


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest