I need help finding where an error is occuring in my code. I use a
try-catch block like this in my global.asa:
try {
//my code
} catch (e) {
Application('er rormsg') = ("An exception occurred in the script. Error
name: " + e.name
+ ". Error description: " + e.description
+ ". Error number: " + e.number
+ ". Error message: " + e.message); }
And this is what is SOMETIMES returned when I display
Application('er rormsg'), the rest of the time, it works:
An exception occurred in the script. Error name: Error. Error description:
Path not found. Error number: -2146828212. Error message: Path not found
But I don't know which path is not found! (I'm using the filesystem object
and importing data from a file into SQL.) Is there a way to display the
line number of the error or more details? Or do I just have to try to catch
the error by going through each bit of code? 3 52001
"Kim Haines" <kl************ **********@cox. net> schreef in bericht
news:x7K6b.4712 8$Qy4.4271@fed1 read05... But I don't know which path is not found! (I'm using the filesystem
object and importing data from a file into SQL.) Is there a way to display the line number of the error or more details? Or do I just have to try to
catch the error by going through each bit of code?
A wild guess, but following MS's logics, try:
+ ". Error line: " + e.line
JW
"Janwillem Borleffs" <jw*@jwbfoto.de mon.nl> wrote in message
news:3f******** *************** @news.euronet.n l... A wild guess, but following MS's logics, try:
+ ". Error line: " + e.line
Oh, I tried that and e.lineNumber. Both return "undefined. "
Then I read that try-catch doesn't provide a way to return the line number
if an error occurs.
I can't figure out which file access is causing the error, and it's
intermittent. I guess I'll start breaking down the code bit by bit.
Thanks.
--k
"Janwillem Borleffs" <jw*@jwbfoto.de mon.nl> schreef in bericht
news:3f******** *************** @news.euronet.n l... A wild guess, but following MS's logics, try:
+ ". Error line: " + e.line
No, doesn't work. When you run the following code in IE, you will see all
the properties and line isn't one of them:
try {
a_fish_in_the_p ool;
} catch (e) {
for (var i in e) alert(i + ' = ' + e[i]);
}
A quick search with Google learned me that Mozilla stores the line number in
the lineNumber property and Opera appends it to the message property.
Perhaps you could use window.onerror instead, eg:
window.onerror = function (err, file, line) {
alert('The following error occured: ' + err + '\n' +
'In file: ' + file + '\n' +
'At line: ' + line);
return true;
}
HTH,
JW This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Erlend Fuglum |
last post by:
Hi everyone,
I'm having some trouble sorting lists. I suspect this might have
something to do with locale settings and/or character
encoding/unicode.
Consider the following example, text containing norwegian special
characters æ, ø and å.
>>> liste =
|
by: Brian Kelley |
last post by:
def res():
try:
a = 1
return
finally:
print "do I get here?"
res()
outputs "do I get here?"
|
by: David Stockwell |
last post by:
In referring to my copy of the python bible, it tells me I can't use all
three items 'try' except and finally. I can use the t/f or t/e
combinations though
What combination can i use if i want to catch the exception and still have a
finally block?
This is a fictional example of what I want....
|
by: William Park |
last post by:
(crossposted to comp.lang.python, because this may be of interest to
them.)
Python has try-block, within which you can raise exception. Once it's
raised, execution breaks out of the try-block and is caught at the end
of try-block.
Now, Bash has similiar feature. I've added try-block and 'raise'
builtin into Bash-3.0. Typical usage would go something like
try
|
by: Steven Bethard |
last post by:
So I have code that looks something like this:
def f(xs):
for x in xs:
y = g(x) # can raise exception AnException
for z in h(y):
k(z) # can raise a variety of exceptions
Now, if g(x) raises AnException, I want to log something and skip the
inner loop (but continue with the outer loop). If k(z) raises an
| |
by: Steve Juranich |
last post by:
I know that this topic has the potential for blowing up in my face,
but I can't help asking. I've been using Python since 1.5.1, so I'm
not what you'd call a "n00b". I dutifully evangelize on the goodness
of Python whenever I talk with fellow developers, but I always hit a
snag when it comes to discussing the finer points of the execution
model (specifically, exceptions).
Without fail, when I start talking with some of the "old-timers"...
|
by: wk6pack |
last post by:
Hi,
I was wondering why when I declare the dim variable outside the try
statement, I could use the .dispose() function but when I declare it inside
the try statement, I get Name 'varname' is not declared.
thanks,
Will
|
by: Sori Schwimmer |
last post by:
Hi,
I think that would be useful to have an improved
version of the "try" statement, as follows:
try(retrys=0,timeout=0):
# things to try
except:
# what to do if failed
|
by: Bob Rock |
last post by:
Hello,
this is something I've been asking myself for sometime ... and now I'd like
to clarify this point.
When should the try block start in a method??? What I mean is, does having
all the code instead of a smaller set of it inside a try clause add any
overhead??? 1What I'd like to understand is if, to be completely sure that
no unhandles exception will get to the user, I can place all the code inside
a try block
and if this practice...
|
by: Shi Mu |
last post by:
very hard for me to understand the difference between
try...except and try...finally
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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...
|
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...
|
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...
|
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...
|
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...
|
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();...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |