Solved

Error routine

Posted on 2001-07-24
6
261 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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

759 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

21 Experts available now in Live!

Get 1:1 Help Now