?
Solved

Error routine

Posted on 2001-07-24
6
Medium Priority
?
268 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
Industry Leaders: 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 120 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

765 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