How catch any error in Dlang like Python try-except?

Marcone marcone at email.com
Sun Mar 15 02:11:21 UTC 2020


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));
	}
}




More information about the Digitalmars-d-learn mailing list