473,651 Members | 2,994 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to return the function or sub where the error occured?

13 New Member
I know you can use erl, to return the line number of the error if you have it set, I would like to return the function or sub where the error occured to my error handeling procedure, any thoughts?

Andrew
Feb 2 '11 #1
2 1636
Stewart Ross
2,545 Recognized Expert Moderator Specialist
Unfortunately there is no direct built-in way to access the call stack to find out which sub or function was active when an error occurred. Some posters have implemented their own stack structures, pushing the name of the current sub or function on entry to the routine and popping the name off at the end of the routine. If you choose to go the same route at least you can then get the top of stack value within your error-handling routine to recover the last routine which was in use.

-Stewart
Feb 6 '11 #2
NeoPa
32,568 Recognized Expert Moderator MVP
Alternatively you can handle errors in all routines. It makes using a standard error routine procedure more complex, but it could be done if only basic things are required from the said routine.
Feb 6 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
28011
by: André Somers | last post by:
Hi, I'm having a problem that I have a hard time understanding. I am getting a "Fatal error: Call to a member function on a non-object" on a constructor of a class, that looks like this (simplified): class phpBB_Template { var $classname = "Template"; // Root template directory.
7
1571
by: dotnettester | last post by:
Hi, I am maintaining some code and I see in some functions.. Function myFunction set someobj = Server.CreateObject("MYOBJ") ..... .... set myFunction = "somedataToReturn"
2
7141
by: comp | last post by:
I have a user control inside an aspx page. I was able to create a Public property inside the ascx file and call it from the aspx but whatever I do, I can't find the way to cause an event from inside the ascx file to call any function/sub/property etc. The error I'm getting is "Reference to a non-shared member required an object reference".
4
1506
by: Captain Chaos | last post by:
Hello I have a class B that has inherited a class A. In Class A there is a Property/Function/Sub/Event implemented that i do not want to see if using Class B. Is it possible to remove some Properties/Function/etc without having access to Class A ?
8
11019
by: Brahm | last post by:
Hey Guys! is there anyway to get in runtime current function or sub name ? Daniel
4
10643
by: astri | last post by:
#include "Unit1.h" #include "math.h" #include "fixed_math.hpp" #include "algorithm.h" #define MBIT 0x4000 #define CBIT 16 long constbl; void __fastcall TForm1::Button1Click(TObject *Sender)
7
5390
by: rwaller | last post by:
Works fine in IE, but not in Firefox? Code below, thank you in advance.... http://www.cnusd.k12.ca.us/roosevelt%2Dhs/Leaving_Site/leavingERHSpavelgcy.html <SCRIPT LANGUAGE=vbscript> function callMsgBox2(strMsg) callMsgBox2 = msgBox(strMsg,4,"Leaving ERHS") end function </SCRIPT>
1
11718
by: eros | last post by:
CREATE OR REPLACE FUNCTION f_customerlogininfo(varchar, varchar, varchar) RETURNS public.v_customerlogininfo AS ' DECLARE p_schm ALIAS FOR $1; p_contact ALIAS FOR $2; p_status ALIAS FOR $3; v_boolstatus boolean; BEGIN IF p_status = ''all'' THEN RETURN (select * from v_customerlogininfo where contact = p_contact); ELSE
6
3102
by: Jahangir | last post by:
Hello All, In my project I am using php calendar. I have used it locally it is working perfactly, but when I upload it on remote server it gives Fatal error: Call to a member function on a non-object in....... in second last line of following code where it gives problem; function put_day($d, $font = 0, $color) { $cur_time = mktime(0, 0, 0, $this->a_selected_date, $d, $this->a_selected_date); $d = date('j', $cur_time); $m =...
0
987
by: MU | last post by:
Hello I have a Repeater Control and I have an image in there where I am passing the FileName from the dataset to a Shared Function/Sub in a class which has ASPThumb in there to send back the binary(?) I'm assuming as it has a method called .Send However, I'm not sure how to go about it. Repeater Control statement
0
8807
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8701
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8466
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8584
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7299
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5615
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1912
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.