Catch exceptions as a reference in alsa::start/end_measurement.

Signed-off-by: Sergey Senozhatsky <[email protected]>

---

diff --git a/devices/alsa.cpp b/devices/alsa.cpp
index 998f25c..b0bcd3f 100644
--- a/devices/alsa.cpp
+++ b/devices/alsa.cpp
@@ -101,8 +101,8 @@ void alsa::start_measurement(void)
                        file >> start_active;
                }
                file.close();
-       } catch (std::ios_base::failure c) {
-               cout << "Fail\n";
+       } catch (std::ios_base::failure &c) {
+               fprintf(stderr, "%s\n", c.what());
        }
 
 }
@@ -127,7 +127,8 @@ void alsa::end_measurement(void)
                        file >> end_active;
                }
                file.close();
-       } catch (std::ios_base::failure c) {
+       } catch (std::ios_base::failure &c) {
+               fprintf(stderr, "%s\n", c.what());
        }
 
 
@@ -215,4 +216,4 @@ const char * alsa::human_name(void)
        if (strlen(guilty) > 0)
                sprintf(temp_buf, "%s (%s)", humanname, guilty);
        return temp_buf;
-}
\ No newline at end of file
+}

_______________________________________________
Discuss mailing list
[email protected]
http://lists.lesswatts.org/listinfo/discuss

Reply via email to