View previous topic :: View next topic |
Author |
Message |
Serge Professional Member
Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Wed Mar 30, 2005 9:02 am Post subject: error reporting |
|
|
i came across an annoying problem with the current error reporting thingy of vds 5, if an error occurs in the code of a user defined command, then vds reports an error at the line that contains the command and not at the line where the error actually occured within the code of the command - does that make sense?
this makes it very hard to troubleshoot when a user reports an error XXX at line XXX because it is the line of the user defined command
could that be fixed for vds 6?
serge _________________
|
|
Back to top |
|
|
jules Professional Member
Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Wed Mar 30, 2005 9:41 am Post subject: |
|
|
This is by design. The idea is that a user defined command or function is a "black box" and the error is returned at the point the command or function is used, just as if it was an internal command or function. Bearing in mind that the command or function could be in a .DSU, the source code may not be available to the application programmer.
When programming a command or function you should use OPTION ERRORTRAP or test the value of @OK() to trap any errors that occur, and then use the ERROR command to return a user-defined error code that describes the problem. _________________ The Tech Pro
www.tech-pro.net |
|
Back to top |
|
|
Serge Professional Member
Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Wed Mar 30, 2005 9:50 am Post subject: |
|
|
i understand now about how it can't be done any other way, thanks jules
serge _________________
|
|
Back to top |
|
|
jwfv Valued Contributor
Joined: 19 Mar 2002 Posts: 422 Location: Beaufort, SC
|
Posted: Wed Jun 29, 2005 3:44 pm Post subject: |
|
|
I have been frustrated by this behavior also, but I understand Jules' response.
Is there the possibility of having VDS return the actual line of code that caused the error? That would be extremely helpful because in 90% of the cases it would tell me exactly what was causing the problem. It would give me a head start when looking through the code, especially when there are multiple copies of my (continually evolving) software out there. Currently I need to keep a separate copy of the code after each update or bug fix so I can track it by line number. _________________ Joe Floyd |
|
Back to top |
|
|
|