Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#3427 closed enhancement (fixed)

[PATCH] Improve error message when trying to replay a directory

Reported by: elexis Owned by: elexis
Priority: Nice to Have Milestone: Alpha 20
Component: Core engine Keywords: patch
Cc: Patch:

Description

If you accidentally give a directory name instead of the path to the commands.txt file when attempting to go into visual- or non-visual replaymode, then you will get the following error:

terminate called after throwing an instance of 'std::ios_base::failure'
  what():  basic_filebuf::underflow error reading the file

As we already have a nice error in case the file doesn't exist, we should check that case too:

static void RunGameOrAtlas(int argc, const char* argv[])
...
		if (!FileExists(OsPath(replayFile)))
		{
			debug_printf("ERROR: The requested replay file '%s' does not exist!\n", replayFile.c_str());
			return;
		}

Attachments (1)

t3427_improve_replay_error_v1.patch (2.5 KB ) - added by elexis 9 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by elexis, 9 years ago

Keywords: patch review added
Milestone: BacklogAlpha 19
Summary: Improve error message when trying to replay a directory[PATCH] Improve error message when trying to replay a directory

comment:2 by Itms, 9 years ago

Milestone: Alpha 19Alpha 20

comment:3 by elexis, 8 years ago

Owner: set to elexis
Resolution: fixed
Status: newclosed

In 17501:

Graceful exit in case of trying to replay a directory. Fixes #3427.
Also remove unneeded variable ran_atlas.

comment:4 by elexis, 8 years ago

Keywords: review removed
Note: See TracTickets for help on using tickets.