• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Exceptions In JavaScript

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys!!.. Hopefully you can help me with this one.
I like to find the list of Exceptions Defenitions so that I can call them in code.
When using the Try{}Catch(e){} I have access to
e.description and
e.number
but does not enough information when an error occur. I like to access the line or origin where the error happened and the name of the error if possible.
Do you know where can I obtain such list? .. if it exist!! or which are the exception names I need to use to call in my code to get such values?
Thanx in advance.
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The default Error object only has two properties: Number and Description. If you are trapping runtime errors, that's all you are going to get. If you want to create and throw your own exceptions, then there are tons of other possibilities. You could create a custom Exception object and assign other properties to it, such as the module that threw the exception. Then in your code you can do risky operations in try blocks. If you get a runtime error, throw your custom exception from inside of the catch block.
 
L Richardson
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Bodie
Thanks alot for responding to my question I think I am going to go with your suggestion, I like the idea of havin your own customize exceptions that you can call from code.
Thanks very much.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic