Re: How to catch line number of exception without catching it ?

2017-12-13 Thread codephantom via Digitalmars-d-learn
On Wednesday, 13 December 2017 at 18:24:09 UTC, Thomas wrote: Or is there a better solution for tracing the error position from root till the branch ? Speaking of tracing exceptions, here's my favourite one .. so far ;-) (I mean come on.. debugging is great fun!) btw. If you compile/run

Re: How to catch line number of exception without catching it ?

2017-12-13 Thread Nathan S. via Digitalmars-d-learn
On Wednesday, 13 December 2017 at 18:24:09 UTC, Thomas wrote: So my question is: Is there a way to catch that line where the exception has happened without a catch ? Yes: use a debugger.

Re: How to catch line number of exception without catching it ?

2017-12-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, December 13, 2017 18:24:09 Thomas via Digitalmars-d-learn wrote: > Hi forks! > > I wanted to ask if there is a way to catch the line position on > an exception without setting a try + catch block ? > What I want is something like this: > > > module main; > > import std.stdio; >

How to catch line number of exception without catching it ?

2017-12-13 Thread Thomas via Digitalmars-d-learn
Hi forks! I wanted to ask if there is a way to catch the line position on an exception without setting a try + catch block ? What I want is something like this: module main; import std.stdio; import std.conv; void foo() { scope(failure) { writeln("Got a