Function fail

Call this to end your program with an error message for the user, and no ugly stack trace. The error message is sent to stderr and the errorlevel is set to non-zero.

void fail(T...) (
  T args
);

This is exception-safe, all cleanup code gets run.

Your program's name is automatically detected from thisExePath.

Example

auto id = 3;
fail("You forgot to provide a destination for id #", id, "!");

// Output:
// yourProgramName: ERROR: You forgot to provide a destination for id #3!