diff options
author | Andrzej Rybczak <electricityispower@gmail.com> | 2016-11-20 19:38:11 +0100 |
---|---|---|
committer | Andrzej Rybczak <electricityispower@gmail.com> | 2016-11-20 19:38:11 +0100 |
commit | 3868e32b9216e14247e0534061d1d02f3b8ab65d (patch) | |
tree | 21479e51cb2cbdd46382b688a30cab8af5c82782 | |
parent | a2ffa72a34906bb8e6c87cc195e59cb5ad411765 (diff) |
Show detailed error message if writing tags fails
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | src/actions.cpp | 4 | ||||
-rw-r--r-- | src/tag_editor.cpp | 4 | ||||
-rw-r--r-- | src/tiny_tag_editor.cpp | 2 |
4 files changed, 6 insertions, 5 deletions
@@ -9,6 +9,7 @@ ncmpcpp-0.8 (????-??-??) * The list of lyrics fetchers can now be set via configuration file. * Lyrics can now be fetched for songs with no tags. * libcurl dependency is no longer optional. +* When an attempt to write tags fails, show detailed error message. ncmpcpp-0.7.7 (2016-10-31) * Fixed compilation on 32bit platforms. diff --git a/src/actions.cpp b/src/actions.cpp index 8f35b70a..699efcaf 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -1392,8 +1392,8 @@ void EditLibraryTag::run() if (!Tags::write(ms)) { success = false; - const char msg[] = "Error while updating tags in \"%1%\""; - Statusbar::printf(msg, wideShorten(ms.getURI(), COLS-const_strlen(msg))); + Statusbar::printf("Error while writing tags to \"%1%\": %2%", + ms.getName(), strerror(errno)); s.finish(); break; } diff --git a/src/tag_editor.cpp b/src/tag_editor.cpp index c77e1d0a..3dcaac5f 100644 --- a/src/tag_editor.cpp +++ b/src/tag_editor.cpp @@ -806,8 +806,8 @@ void TagEditor::runAction() Statusbar::printf("Writing tags in \"%1%\"...", (*it)->getName()); if (!Tags::write(**it)) { - const char msg[] = "Error while writing tags in \"%1%\""; - Statusbar::printf(msg, wideShorten((*it)->getURI(), COLS-const_strlen(msg)).c_str()); + Statusbar::printf("Error while writing tags to \"%1%\": %2%", + (*it)->getName(), strerror(errno)); success = 0; break; } diff --git a/src/tiny_tag_editor.cpp b/src/tiny_tag_editor.cpp index 9bbc8d2e..2abdf08a 100644 --- a/src/tiny_tag_editor.cpp +++ b/src/tiny_tag_editor.cpp @@ -172,7 +172,7 @@ void TinyTagEditor::runAction() } } else - Statusbar::print("Error while writing tags"); + Statusbar::printf("Error while writing tags: %1%", strerror(errno)); } if (option > 21) m_previous_screen->switchTo(); |