Solved

Error routine

Posted on 2001-07-24
6
267 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

728 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