Rodger
New member
Hello,
we are porting over 300.000 lines of code from VB6 into VB.NET.
The application is a very complex bookkeeping program having much technical booking logic, developed over many year from different programmers using different programming styles.
I am involved with writing the coding guidelines, and the most difficult of all is the error handling.
In the massive VB6 application all types of error handling were used, and in some places no error handling at all.
In VB6 'On error goto' and 'On Error Resume next' is used, having a single door out at the end of the program.
In some places err.raise was used to cause the program logic to throw control into some other routine. Layer after layer of such coding has caused a huge amount of combination errors where the error messages often are no longer correct.
Here is what I think would be the best, but I would like to know from some others having similiar experiences if it is the best way to go.
1. Do not use Throw and err.raise, but instead use integer return codes after catching the errors
2. Always check the return status to assure the function completed properly and to know how to handle the exception. I
3. Pass the control to the end of the routine (methods) and return to the routine the error code.
2. Display any system error messages (Old: Parameters identifying the procedure where the error occurred; New: exception.tostring) in the routines where the error occurs. (The programs are written in such a way that only critical exceptions occur)
3. Have for the application a general error handler, and then for certain Forms a form specific Error handler to catch any unexpected exceptions and return control to the initial state of the application / form.
Can anyone who has had experience with large amount of ported code from VB6 give me some advice?
Rodger
In the future we wish to take advantage of the VB.NET Try / Catch error handling.
functionality than probably any other
we are porting over 300.000 lines of code from VB6 into VB.NET.
The application is a very complex bookkeeping program having much technical booking logic, developed over many year from different programmers using different programming styles.
I am involved with writing the coding guidelines, and the most difficult of all is the error handling.
In the massive VB6 application all types of error handling were used, and in some places no error handling at all.
In VB6 'On error goto' and 'On Error Resume next' is used, having a single door out at the end of the program.
In some places err.raise was used to cause the program logic to throw control into some other routine. Layer after layer of such coding has caused a huge amount of combination errors where the error messages often are no longer correct.
Here is what I think would be the best, but I would like to know from some others having similiar experiences if it is the best way to go.
1. Do not use Throw and err.raise, but instead use integer return codes after catching the errors
2. Always check the return status to assure the function completed properly and to know how to handle the exception. I
3. Pass the control to the end of the routine (methods) and return to the routine the error code.
2. Display any system error messages (Old: Parameters identifying the procedure where the error occurred; New: exception.tostring) in the routines where the error occurs. (The programs are written in such a way that only critical exceptions occur)
3. Have for the application a general error handler, and then for certain Forms a form specific Error handler to catch any unexpected exceptions and return control to the initial state of the application / form.
Can anyone who has had experience with large amount of ported code from VB6 give me some advice?
Rodger
In the future we wish to take advantage of the VB.NET Try / Catch error handling.
functionality than probably any other