Skip to content

Commit

Permalink
display error message in gui app
Browse files Browse the repository at this point in the history
  • Loading branch information
thekvs committed Nov 25, 2016
1 parent 9b779f2 commit 8590e94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ endif()

set(TARGET_VERSION_MAJOR 0)
set(TARGET_VERSION_MINOR 2)
set(TARGET_VERSION_PATCH 8)
set(TARGET_VERSION_PATCH 9)
set(APP_VERSION "${TARGET_VERSION_MAJOR}.${TARGET_VERSION_MINOR}.${TARGET_VERSION_PATCH}")

add_subdirectory(src)
Expand Down
8 changes: 5 additions & 3 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,16 @@ Player::on_bus_message(const Glib::RefPtr<Gst::Bus>& /*bus*/, const Glib::RefPtr
play_next_stream();
} else if (message_type == Gst::MESSAGE_ERROR) {
auto error_msg = Glib::RefPtr<Gst::MessageError>::cast_static(message);
Glib::ustring e = "Error";

if (error_msg) {
Glib::Error err = error_msg->parse();
LOG(ERROR) << "Error: " << err.what();
} else {
LOG(ERROR) << "Error.";
e.append(": ").append(err.what());
}

LOG(ERROR) << e;
em->broadcast_info_changed(current_station, e);

play_next_stream();
} else if (message_type == Gst::MESSAGE_TAG) {
auto msg_tag = Glib::RefPtr<Gst::MessageTag>::cast_static(message);
Expand Down

0 comments on commit 8590e94

Please sign in to comment.