473,721 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Suppressing err msg globally

Hi,

A web app server package that I'm using includes a bunch of open
source UI components (heavy with javascripts). Inevitably it has
bugs, e.g. "undefined" is null or not an object.

This naturally erodes confidence for novice web users for the app in
question.

The techniques that I found and tried after research for suppressing
javascript err mgs either completely stop all the js running or
ineffective. Got an idea?

Thanks.
Apr 1 '08 #1
5 2468
Don Li wrote:
A web app server package that I'm using includes a bunch
of open source UI components (heavy with javascripts).
Inevitably it has bugs, e.g. "undefined" is null or not
an object.

This naturally erodes confidence for novice web users for
the app in question.
The implication being, I suppose, that experienced web users would have
no confidence in the application to start with and so a series of script
error messages could no erode their confidence.
The techniques that I found and tried after research
for suppressing javascript err mgs
That would easily be the very worst thing you could ever do.
either completely
stop all the js running
That would do it.
or ineffective.
You are obviously looking in the wrong place for advice as suppressing
all javascript errors is trivial, but an incredibly bad idea.
Got an idea?
Debug and correct the code you have or use better code to start with.

Richard.
Apr 1 '08 #2
Don Li wrote:
>On Apr 1, 5:20 pm, Jeremy J Starcher wrote:
<snip>
>Hiding error messages leads to further problems down the road,
should any real errors begin to occur. You are trying to open
Pandora's box of debugging.

Thirdly, while most UAs (User Agents/browsers) will continue
running in case of an error, there is no requirement that they
do so.
<snip>
>"Hiding error messages leads to further problems down the road,
should any real errors begin to occur."
>That's why we have Dev vs Production, on the Dev, err msgs won't
be suppressed.
If you don't have people who either already know how to suppress all
error messages (and why it would be a suicidal bad idea) or how to
identify cause and effect relationships that result in error messages
and so how to fix them then you don't have 'development' at all. Just
some sort of uncontrolled code aggregation process. Any confidence in
the outcome is already unfounded.

Richard.
Apr 2 '08 #3
rf

"Don Li" <ta********@gma il.comwrote in message
news:3b******** *************** ***********@d45 g2000hsc.google groups.com...
"Hiding error messages leads to further problems down the road, should
any
real errors begin to occur."
That's why we have Dev vs Production, on the Dev, err msgs won't be
suppressed.
No. You have this wrong [1].

You have a development environment so you can find and correct the errors.
All of them.

When a development environment is free of errors and, hopefully, works
correctly, you may promote it to the production environment.

If you have *any errors at all* in a specific development environment then
that canditate is not eligable for promotion to production status. There
shall be NO [known] errors in the production environment.

At least that's what they taught us in Programming 101 back in nineteen
seventy three. I would hope it still applies.

However I see that you are a google groper. All bets are off then :-)

[1] You *may* in your development environment allow all sorts of debugging
stuff to happen, alerts and what not, that will be suppressed in the
production environment. But not so for errors.
--
Richard.
Apr 2 '08 #4
VK
On Apr 1, 10:07 pm, Don Li <tatata9...@gma il.comwrote:
Hi,

A web app server package that I'm using includes a bunch of open
source UI components (heavy with javascripts). Inevitably it has
bugs, e.g. "undefined" is null or not an object.

This naturally erodes confidence for novice web users for the app in
question.

The techniques that I found and tried after research for suppressing
javascript err mgs either completely stop all the js running or
ineffective. Got an idea?
window.onerror = function(){retu rn true;};
or (equivalent):
<body onerror="return true;">

That prevents from showing any error messages, but on the first
runtime error occurred the script execution will stop globally, as you
already properly noticed. The only workaround exists for Gecko
browsers implementing multi-threating in Javascript (it was necessary
as the whole top and middle layer of Gecko are written in Javascript).
For Gecko the execution and clean up happen only for the current
execution context, so on unhandled runtime error one may escape to a
parallel context over timeout:

window.onerror = function(){
window.setTimeo ut('resumeNext( )',1);
return true;
}

That is a very risky way to handle anything and I would strongly
oppose to such coding moreover it's Gecko-only. Still I had to
mention.

Javascript doesn't have On Error Resume Next and similar constructs.
This way the only mean to prevent errors bubbling yet keep the script
executing is to try to wrap it in whole into try-catch block. Uhmm...
Do you really want to try that? :-)

So no, there is not anything close to what you are asking about.
Apr 3 '08 #5
On Apr 3, 2:50*pm, VK <schools_r...@y ahoo.comwrote:
On Apr 1, 10:07 pm, Don Li <tatata9...@gma il.comwrote:
Hi,
A web app server package that I'm using includes a bunch of open
source UI components (heavy with javascripts). *Inevitably it has
bugs, e.g. "undefined" is null or not an object.
This naturally erodes confidence for novice web users for the app in
question.
The techniques that I found and tried after research for suppressing
javascript err mgs either completely stop all the js running or
ineffective. *Got an idea?

window.onerror = function(){retu rn true;};
*or (equivalent):
<body onerror="return true;">

That prevents from showing any error messages, but on the first
runtime error occurred the script execution will stop globally, as you
already properly noticed. The only workaround exists for Gecko
browsers implementing multi-threating in Javascript (it was necessary
as the whole top and middle layer of Gecko are written in Javascript).
For Gecko the execution and clean up happen only for the current
execution context, so on unhandled runtime error one may escape to a
parallel context over timeout:

window.onerror = function(){
*window.setTime out('resumeNext ()',1);
*return true;

}

That is a very risky way to handle anything and I would strongly
oppose to such coding moreover it's Gecko-only. Still I had to
mention.

Javascript doesn't have On Error Resume Next and similar constructs.
This way the only mean to prevent errors bubbling yet keep the script
executing is to try to wrap it in whole into try-catch block. Uhmm...
Do you really want to try that? :-)

So no, there is not anything close to what you are asking about.
Thanks.
Apr 3 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
3386
by: steve | last post by:
Dontí make my mistake. It is costly. Say you have defined a variable $var in your main script. Now in a function you access it using: global $var; But you want to set it to null inside the function. DO: $var = null; DONT DO: unset($var);
13
1712
by: Jean-FranÁois Doyon | last post by:
Hello, I'm using MetaClasses to create classes. How do I make these new classes "globally" available? I probably just have to assign them to something magic, but I can't seem to figure out which one. if I do:
4
1888
by: Otto Lind | last post by:
The following program shows the problem: #include <stdio.h> namespace x { enum L { One = 1, Two = 2 }; namespace x { enum L { Three = 3, Four = 4 };
40
7879
by: Dave Hansen | last post by:
Please note crosspost. Often when writing code requiring function pointers, it is necessary to write functions that ignore their formal parameters. For example, a state machine function might take a status input, but a certain error-handling state might ignore it: typedef void (*State_Fn)(uint8_t); void error_state(uint8_t status)
2
2284
by: aevans1108 | last post by:
Greetings Please give me a push in the right direction if this the wrong place to ask this question. Why is it that I can get the count of facets for an element restriction if the corresponding simpleType is declared inline, but I can't get it if the simpleType is globally defined? Given this schema:
2
2382
by: stevie.greenslade | last post by:
'Lo all. I have a simple question I'd like help on. :] How, if at all, would one go about suppressing the console window that flashes up when you make at system() call in your C++ program? I'm using Dev-C++ with GTK-- with all the 'GUI' options ticked. There is nothing functionally wrong with the program save this flashing console window.
1
2136
by: janefield2002 | last post by:
Hi there, I have a client-server application that periodically connects to an Access database on a network. My netowrk sometimes goes down and there is an ODBC failure to connect. This results in an ODBC error pop up window. I am interested in suppressing this pop up, catching the exception and simply saying "network is down" or something like that. Is this possible? How is this done? My application is VB 6.
0
731
by: Paul Moore | last post by:
How can I suppress a Python warning globally (i.e., for all instances of Python I run)? I have a test suite that runs Python via sys.executable, so the -W flag won't work. A wrapper script doesn't work, as sys.executable doesn't point to that. And PYTHONSTARTUP is only for interactive use, so that's no good... Is there an obvious way I've missed? Surely this is a common issue? Paul.
0
770
by: Jean-Paul Calderone | last post by:
On Thu, 2 Oct 2008 23:39:29 +0100, Paul Moore <p.f.moore@gmail.comwrote: Site-wide configuration is what site customization modules are for. Check out sitecustomize.py in /usr/lib/python<version>/ or the equivalent for your platform/installation. Jean-Paul
0
8852
marktang
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...
0
9373
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
9227
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
9145
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
9081
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
5992
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();...
1
3206
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
2
2590
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2143
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.