Re: [V4REV] Discussion of Error Notification.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [V4REV] Discussion of Error Notification.

Ruslan Zasukhin
On 6/12/05 2:17 AM, "Robert Brenstein" <[hidden email]> wrote:

> I think the current method of returning error is fine (your #2). At
> least it is consistent with the way other call return errors. Or are
> you planning to handle errors differently in V2?

For now we have made it as "Error nnn"

But we wonder if exists any better way for Revolution ?

Revolution do not have exceptions, right?

And it is better return "Error nnn" to avoid extra call
        Database_LastError

Right ?


--
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]


_______________________________________________
use-revolution mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: [V4REV] Discussion of Error Notification.

Robert Brenstein
At 08:41 +0300 12.06.2005, Ruslan Zasukhin wrote:

>On 6/12/05 2:17 AM, "Robert Brenstein" <[hidden email]> wrote:
>
>>  I think the current method of returning error is fine (your #2). At
>>  least it is consistent with the way other call return errors. Or are
>>  you planning to handle errors differently in V2?
>
>For now we have made it as "Error nnn"
>
>But we wonder if exists any better way for Revolution ?
>
>Revolution do not have exceptions, right?
>
>And it is better return "Error nnn" to avoid extra call
>         Database_LastError
>
>Right ?
>

Revolution has exceptions and we can trigger them in Transcript. Look
at the "try" structure and the "throw" command. However, I'd
personally rather keep exceptions for trapping runtime execution
errors and special situations.

I find it easy enough and convenient to handle getting "error xxx" in
the result, although in principle, either this way or
"Database_LastError" are fine as long as it is consistent. On the
other hand, the small but nevertheless overhead of the extra function
call to "Database_LastError" may add up when running loops through
thousands of records, particularly as it may be called multiple times
in a single loop.

The only thing that I find somewhat annoying in this area with
Valentina 1.x is that while most functions return "error", some
functions return false in case of failure and some return 0. Because
of that I need always 3 different assertion handlers and make sure to
use the right one after any Valentina call.

Robert
_______________________________________________
use-revolution mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/use-revolution