call traceback is indecipherable garbage
forkit
forkit at gmail.com
Wed Jan 26 05:17:48 UTC 2022
On Wednesday, 26 January 2022 at 04:25:47 UTC, H. S. Teoh wrote:
>
> It's easy, just wrap your main() in a try-catch block:
>
> int main() {
> try {
> // ... rest of code goes here
> return 0;
> } catch(Exception e) {
> writeln("Error: %s", e.msg);
> return 1;
> }
> }
>
>
> T
great!
.. now my 2 little lines of code, has turned into all this
peripheral nonesense, just to avoid displaying the useless stack
dump.
;-(
// --
module test;
import std;
int main()
{
try
{
auto f = File("d://tewxt.txt").byLine;
f.take(1).each!writeln;
return 0;
}
catch(Exception e)
{
writeln("Error: %s", e.msg);
return 1;
}
}
// ---
More information about the Digitalmars-d
mailing list