summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-11-05 10:52:23 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-11-05 10:52:23 +0100
commitefe406d9724f959c8bc2a31802559ca6d41fd897 (patch)
treefc1c2cc742ec4871c573d7bc3d0e1f1ee20c7c98 /src
parent3254bbbf2e06e9013e8468643344683cf2783f50 (diff)
downloadODR-AudioEnc-efe406d9724f959c8bc2a31802559ca6d41fd897.tar.gz
ODR-AudioEnc-efe406d9724f959c8bc2a31802559ca6d41fd897.tar.bz2
ODR-AudioEnc-efe406d9724f959c8bc2a31802559ca6d41fd897.zip
Catch runtime_errors that reach main()
Diffstat (limited to 'src')
-rw-r--r--src/odr-audioenc.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/odr-audioenc.cpp b/src/odr-audioenc.cpp
index f4cf01e..9dd10ba 100644
--- a/src/odr-audioenc.cpp
+++ b/src/odr-audioenc.cpp
@@ -1523,6 +1523,12 @@ int main(int argc, char *argv[])
}
}
- return audio_enc.run();
+ try {
+ return audio_enc.run();
+ }
+ catch (const std::runtime_error& e) {
+ fprintf(stderr, "ODR-AudioEnc failed to start: %s\n", e.what());
+ return 1;
+ }
}