From efe406d9724f959c8bc2a31802559ca6d41fd897 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 5 Nov 2019 10:52:23 +0100 Subject: Catch runtime_errors that reach main() --- src/odr-audioenc.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') 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; + } } -- cgit v1.2.3