On 05/09/14 13:17, Ingwie Phoenix wrote:
>
> In either case, I get the base idea of it. But what I dont get, is any
> information on the structure of an Error object.
This is a V8 object, and it contains -to the best of my knowledge:
- name (type of error);
- message (the string you pass to the constructor);
- stack (the stack trace).
Like in:
> var error = new Error("My error message");
>
error.name
'Error'
> error.message
'My error message'
> error.stack
'Error: My error message\n at repl:1:13\n at REPLServer.self.eval
(repl.js:110:21)\n at repl.js:249:20\n at REPLServer.self.eval
(repl.js:122:7)\n at Interface.<anonymous> (repl.js:239:12)\n at
Interface.EventEmitter.emit (events.js:95:17)\n at Interface._onLine
(readline.js:202:10)\n at Interface._line (readline.js:531:8)\n at
Interface._ttyWrite (readline.js:760:14)\n at ReadStream.onkeypress
(readline.js:99:10)'
Of course, once created, you can add more properties to it to fit your case.
Regards,
Luca Morandini
Data Architect - AURIN project
Melbourne eResearch Group
Department of Computing and Information Systems
University of Melbourne
Tel. +61 03 903 58 380
Skype: lmorandini