summaryrefslogtreecommitdiffstatshomepage
path: root/src/tools
diff options
context:
space:
mode:
author Oliver Stöneberg <firewave@users.noreply.github.com>2014-09-08 18:46:40 +0000
committer Oliver Stöneberg <firewave@users.noreply.github.com>2014-09-08 18:46:40 +0000
commit82a99c44523567b268803f2d3f48c8caaf7ae9a0 (patch)
tree178008abf6369d7a7cfc6099a5343f797e190ce2 /src/tools
parenteb9a3ddc7006402828d4d2ed3db629cc3f9c6003 (diff)
moved tagged_list:: out of tagged_list to make it catch-able / handle add_exception / updated exception handling unidasm to match the main one and return a proper exitcode in case of an error (nw)
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/unidasm.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/tools/unidasm.c b/src/tools/unidasm.c
index 6b03c2d7cad..0101de8a258 100644
--- a/src/tools/unidasm.c
+++ b/src/tools/unidasm.c
@@ -644,20 +644,29 @@ int main(int argc, char *argv[])
catch (emu_fatalerror &fatal)
{
fprintf(stderr, "%s\n", fatal.string());
+ result = 1;
if (fatal.exitcode() != 0)
result = fatal.exitcode();
}
catch (emu_exception &)
{
fprintf(stderr, "Caught unhandled emulator exception\n");
+ result = 1;
}
- catch (std::bad_alloc &)
+ catch (add_exception &aex)
{
- fprintf(stderr, "Out of memory!\n");
+ fprintf(stderr, "Tag '%s' already exists in tagged_list\n", aex.tag());
+ result = 1;
+ }
+ catch (std::exception &ex)
+ {
+ fprintf(stderr, "Caught unhandled %s exception: %s\n", typeid(ex).name(), ex.what());
+ result = 1;
}
catch (...)
{
fprintf(stderr, "Caught unhandled exception\n");
+ result = 1;
}
osd_free(data);