From 1f6b4591b4697a3acf228e694c490cc5f75ae4e4 Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Tue, 29 Sep 2015 20:38:53 +0300 Subject: Add rest of missing Card exceptions. --- libkms++/card.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libkms++/card.cpp') diff --git a/libkms++/card.cpp b/libkms++/card.cpp index 626c424..7aa8bdb 100644 --- a/libkms++/card.cpp +++ b/libkms++/card.cpp @@ -136,7 +136,7 @@ Property* Card::get_prop(const char *name) const return prop; } - throw invalid_argument("foo"); + throw invalid_argument(string("Card property ") + name + " not found"); } Connector* Card::get_first_connected_connector() const @@ -193,7 +193,7 @@ Crtc* Card::get_crtc_by_index(uint32_t idx) const if (crtc && crtc->idx() == idx) return crtc; } - throw invalid_argument("fob"); + throw invalid_argument(string("Crtc #") + to_string(idx) + "not found"); } Crtc* Card::get_crtc(uint32_t id) const { return dynamic_cast(get_object(id)); } @@ -221,7 +221,9 @@ std::vector Card::get_connected_pipelines() } if (!crtc) - throw invalid_argument("fob"); + throw invalid_argument(string("Connector #") + + to_string(conn->idx()) + + " has no possible crtcs"); outputs.push_back(Pipeline { crtc, conn }); } -- cgit v1.2.3 From ef7fa369385fc99be4c861e5b3d444e32c5c101b Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Tue, 29 Sep 2015 20:41:19 +0300 Subject: There is no need to convert exception strings to .c_str(). --- libkms++/card.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libkms++/card.cpp') diff --git a/libkms++/card.cpp b/libkms++/card.cpp index 7aa8bdb..52a0f7a 100644 --- a/libkms++/card.cpp +++ b/libkms++/card.cpp @@ -26,8 +26,8 @@ Card::Card() int fd = open(card, O_RDWR | O_CLOEXEC); if (fd < 0) - throw invalid_argument((string(strerror(errno)) + - " opening " + card).c_str()); + throw invalid_argument(string(strerror(errno)) + " opening " + + card); m_fd = fd; int r; @@ -222,7 +222,7 @@ std::vector Card::get_connected_pipelines() if (!crtc) throw invalid_argument(string("Connector #") + - to_string(conn->idx()) + + to_string(conn->idx()) + " has no possible crtcs"); outputs.push_back(Pipeline { crtc, conn }); -- cgit v1.2.3