How do you catch exceptions in javascript?

How do you handle exceptions in javascript?? how do you catch? how do you will maintain it?? bla bla..hitting these questions on brain like stones??

Just logon to bugsense to clarigy these…

Steps:

1. Download the bugsense-.js file (or download one of our builds) and store in it along with your other Javascript files.

2.

Include the script in your HTML page and initialize it.

<script src="/path/to/bugsense.js" type='text/javascript'></script>
<script type="text/javascript">
  Bugsense.initAndStartSession({ apiKey: 'YOUR_API_KEY' });
</script>
3.
try {
   rotateScreen();
} catch ( error ) {
   Bugsense.notify( error, { rotation: 'not supported' } );
};

4. Now all your exceptions will be stored in your account.

Note: You have to register with bugsense and get an api key for that. Now all exceptions will be stored in your account log.

References: https://github.com/bugsense/docs

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s