Program.cs: only save errors if not DEUBG