Exceptions checking

Bart Pietercil bart.pietercil at cognosis.be
Sun Sep 14 13:20:57 CDT 2008


On 12 Sep 2008, at 15:01, Ruslan Zasukhin wrote:

> On 9/12/08 3:02 PM, "Ivan Smahin" <ivan_smahin at paradigmasoft.com>  
> wrote:
>
>>> Look what we need to do is have error.xml files for all our  
>>> interface
>>> languages (for the moment three)
>>> So I need to have in case of an exception inside my procedure THAT
>>> ENDS THE PROCEDURE (let's say a duplicate in a unique) I would  
>>> like to
>>> return to PHP the errorcode
>>> Then PHP can decide based on the clients language wat error message
>>> will be displayed (english, dutch or french).
>>
>>> Therefore I think we need our 3 edited (for language) own copies of
>>> error.xml  inside our language specific directories.
>>
>>> So when php calls a stored procedure I can have a fallback like this
>>
>>> EXCEPTION
>>>        WHEN OTHERS THEN
>>>                return @@LastErrorCode
>>> END;
>>
>>> Then php can pick up the errorcode and proces for the appropriate
>>> language.
>>
>>> Will this work ?
>>
>> Yes, it should work.
>>
>> Generally speaking we can do something like this:
>> (It's only my vision)
>>
>> 1. There are 3 sources of states - sql_errors.xml, kernel_errors.xml,
>> userdefined_errors.xml
>>
>> 2. userdefined_errors.xml consist of single <GROUP name="User-defined
>> errors">  element. SQLSTATEs could be in 0x50000 - 0x59999 range
>>
>> 3. It could be English, German and so on clones placed in
>> vResources/English, vResources/German ...
>>
>> 4. We use connection property "Language" to determine which language
>> is preferable for the current user (Default is English). And prepare
>> the message using appropriate xml clone.
>>
>> What do you think?
>
> Yes, this idea is our dream
>
>    VRecources/English/*.xml
>    VRecources/German/*.xml
>
> Third party developer must be able translate xml files self, put  
> them into
> additional folder, and setup own language.
>
> I think name of language should be the same as name of folder,
>    so in SQL will sounds like
>
>        SET PROPERTY Language OF CONNECTION TO 'German'
>
> And engine must search for folder with such name and load XMLs from  
> there.
>
>
> This feature not works yet. Request via Mantis if needed.
>


I think it would be a mistake to name the file after a language. Years  
of experience in multi-lingual programming has let me to believe
that the only viable soultion is specifiying the full file path (or  
directory in this case) to use at the connection level.

In our case that would be
	SET PROPERTY exceptiondirectory OF CONNECTION TO 'specify a FULL path  
here'

we need to be able to specify a full path here because then the only  
thing  needed is that the vserver can 'reach out' to this directory.
The reason I want it OUTSIDE of anything that has to do with Valentina  
is because I want to be able to parse the xml from the client app.
In our case that would be PHP.

And I most certainly do NOT want to give APACHE  webacces to a  
directory that leads to the database engine (seems silly from a  
security standpoint).
So I want it the other way around, no files inside Valentina Paths but  
being able to specify to valentina where it can find the files to use  
in exception reporting.

It seems to me it would be a minor change for Valentina and it would  
make the xml solution immediately workable for all clients that know  
how to handle an xml-file.


Hope you get the idea

thx

Bart













More information about the Valentina mailing list