digitalmars.D.learn - How catch any error in Dlang like Python try-except?
- Marcone (14/14) Mar 14 2020 How catch any error in Dlang like Python tray-except?
- Adam D. Ruppe (4/6) Mar 14 2020 The compiler catches all compile errors. It is impossible to even
How catch any error in Dlang like Python tray-except? It is very useful when making tests. But only who came from interpreted languages can understand. Exemple: import std; void main() { try { writelnX("try function that not exist"); } catch (Throwable e) { writeln("Error: %s".format(e.msg)); } }
Mar 14 2020
On Sunday, 15 March 2020 at 02:11:21 UTC, Marcone wrote:It is very useful when making tests. But only who came from interpreted languages can understand.The compiler catches all compile errors. It is impossible to even run a program if there is even a single compile error. Thus they cannot be caught.
Mar 14 2020