diff options
author | 2015-01-16 18:03:34 +0100 | |
---|---|---|
committer | 2015-01-16 18:03:34 +0100 | |
commit | e11953e91dbec06e8e62d759fe34ede20666f94e (patch) | |
tree | f8d7ea91730fbca038ef4b6a924a7520bf1d16cd | |
parent | de52468837a78371b877d9acec3d96945d43388d (diff) |
added missing catch in chd_file_compressor::async_read() and chdman main() (nw)
happens when e.g. disk is full
-rw-r--r-- | src/lib/util/chd.c | 5 | ||||
-rw-r--r-- | src/tools/chdman.c | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/util/chd.c b/src/lib/util/chd.c index 10f85fce4f2..43539103d33 100644 --- a/src/lib/util/chd.c +++ b/src/lib/util/chd.c @@ -2665,6 +2665,11 @@ void chd_file_compressor::async_read() // advance the read pointer m_read_done_offset += numbytes; } + catch (chd_error& err) + { + fprintf(stderr, "CHD error occured: %s\n", chd_file::error_string(err)); + m_read_error = true; + } catch (std::exception& ex) { fprintf(stderr, "exception occured: %s\n", ex.what()); diff --git a/src/tools/chdman.c b/src/tools/chdman.c index e9919bc9625..a824c701d74 100644 --- a/src/tools/chdman.c +++ b/src/tools/chdman.c @@ -2923,8 +2923,14 @@ int CLIB_DECL main(int argc, char *argv[]) (*s_commands[cmdnum].handler)(parameters); return 0; } + catch (chd_error &err) + { + fprintf(stderr, "CHD error occured (main): %s\n", chd_file::error_string(err)); + return 1; + } catch (fatal_error &err) { + fprintf(stderr, "Fatal error occured: %d\n", err.error()); return err.error(); } catch (std::exception& ex) |