scope exception do not rise

Suliman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Nov 5 04:56:39 PST 2014


void openFile(string fname, string current_folder)
{
	auto file = readText(current_folder ~ fname);
	scope(failure)
	{
		writeln("failure");
	}

//	writeln(file);

}

if file name do not exists, I want to rise scope exception. But 
it's do not rise, and I am getting only standard error like:

std.file.FileException at std\file.d(191): 
D:\code\d\App1\source\app.d1: ╨Э╨╡ ╤Г╨┤╨
░╨╡╤В╤Б╤П ╨╜╨░╨╣╤В╨╕ ╤Г╨║╨░╨╖╨░╨╜╨╜╤Л╨╣ ╤Д╨░╨╣╨╗.
----------------

what's wrong? if I use block "success" it's work fine.


More information about the Digitalmars-d-learn mailing list