Solved

Error routine

Posted on 2001-07-24
6
262 Views
Last Modified: 2013-12-18
Hello Friends,
   i want to do folowing type of functionality.
   in main routine i hae error handler. and some sub routines have been called. in that subroutine if error raises then i want to pick that subroutines name parameter( so that in main routine i can understand where error is raised) pass it to main routine. is it possible?
thanks,
shrirang  
0
Comment
Question by:shrihalbe
  • 3
  • 2
6 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6314107
It cannot give you dynamically what sub has raised the error, you have to code it accordingly. That is hard code the sub, as you will not change the name often for the sub it is OK !

~Hemanth
0
 

Author Comment

by:shrihalbe
ID: 6314176
Hello Hemanth,
That is fine. i am not going to change the name of the routines. but some error occurs in subroutine then control will move to main routine error handler and it passes the name of the subroutine in which error occured. so that i can send mail to administrator where error has occured

Thanks,
 shrirang
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6314218
Notes log would be appropriate to log the errors so that from anywhere you can log the errors.

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:shrihalbe
ID: 6317479
i want to take action when error occurs in the main routine. not in the subroutine. so i want some parameter to be passed from the suroutine and in main error routine i would write code to handle that coresponds to subroutine.
      another think what i feel that. once error occurs in the subroutine then subroutine error handler will handle that error and that won't pass control to main routine error handle. where actually i want to write a code.

thanks,
shrirang
0
 
LVL 2

Accepted Solution

by:
typerracer earned 30 total points
ID: 6319730
Shrirang,

It sounds like you want a way to identify what subroutine raised the error being reported by the main error routine.  If so, try the following:

' In the global Declarations define g_sCurrentSubroutine

Dim g_sCurrentSubroutine as string

' at the beginning of each subroutine, add the following lines of code:

Dim sLastSubroutine as string

sLastSubroutine = g_sCurrentSubroutine
g_sCurrentSubroutine = <insert subroutine name here>

' the last line of each subroutine should read:

'reset the current subroutine name only upon successful completion of the subroutine
g_sCurrentSuboutine = sLastSubroutine
0
 

Author Comment

by:shrihalbe
ID: 6334953
Thanks  typerracer ,
  Really appreciated.
Shrirang
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now