Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #21038

Re: Throw custom errors

Message-ID <26013223.e07e5D6Rpa@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Organization PointedEars Software (PES)
Date 2013-08-23 16:35 +0200
Subject Re: Throw custom errors
Newsgroups comp.lang.javascript
References <2ccb206a-1a96-4852-a481-06490f106bce@googlegroups.com>

Show all headers | View raw


CodeMeteor wrote:

> In the functions that I'm writing I throw an error when the given
> arguments are not of the correct datatype. When the error occurs, in the
> debug console of my web browser (chrome) the line number and file of the
> error that is shown is that where my throw statement is executed. Is it
> possible to make this line number and file show the line and file in which
> my function is called?

No, but the line and the script resource is one of the next items in the 
stack trace.

To this end, you might want to look into or use jsx.throwThis() which 
provides the information independent (but compatible to) the respective 
error console:

<http://PointedEars.de/websvn/filedetails.php?repname=JSX&path=%2Ftrunk%2Fobject.js>

Please get a real name, and use linebreaks.

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Throw custom errors CodeMeteor <TimDGCB@gmail.com> - 2013-08-22 23:59 -0700
  Re: Throw custom errors Stefan Weiss <krewecherl@gmail.com> - 2013-08-23 10:20 +0200
  Re: Throw custom errors Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-08-23 16:35 +0200

csiph-web