Show detailed error message if writing tags fails

This commit is contained in:
Andrzej Rybczak
2016-11-20 19:38:11 +01:00
parent a2ffa72a34
commit 3868e32b92
4 changed files with 6 additions and 5 deletions

1
NEWS
View File

@@ -9,6 +9,7 @@ ncmpcpp-0.8 (????-??-??)
* The list of lyrics fetchers can now be set via configuration file. * The list of lyrics fetchers can now be set via configuration file.
* Lyrics can now be fetched for songs with no tags. * Lyrics can now be fetched for songs with no tags.
* libcurl dependency is no longer optional. * libcurl dependency is no longer optional.
* When an attempt to write tags fails, show detailed error message.
ncmpcpp-0.7.7 (2016-10-31) ncmpcpp-0.7.7 (2016-10-31)
* Fixed compilation on 32bit platforms. * Fixed compilation on 32bit platforms.

View File

@@ -1392,8 +1392,8 @@ void EditLibraryTag::run()
if (!Tags::write(ms)) if (!Tags::write(ms))
{ {
success = false; success = false;
const char msg[] = "Error while updating tags in \"%1%\""; Statusbar::printf("Error while writing tags to \"%1%\": %2%",
Statusbar::printf(msg, wideShorten(ms.getURI(), COLS-const_strlen(msg))); ms.getName(), strerror(errno));
s.finish(); s.finish();
break; break;
} }

View File

@@ -806,8 +806,8 @@ void TagEditor::runAction()
Statusbar::printf("Writing tags in \"%1%\"...", (*it)->getName()); Statusbar::printf("Writing tags in \"%1%\"...", (*it)->getName());
if (!Tags::write(**it)) if (!Tags::write(**it))
{ {
const char msg[] = "Error while writing tags in \"%1%\""; Statusbar::printf("Error while writing tags to \"%1%\": %2%",
Statusbar::printf(msg, wideShorten((*it)->getURI(), COLS-const_strlen(msg)).c_str()); (*it)->getName(), strerror(errno));
success = 0; success = 0;
break; break;
} }

View File

@@ -172,7 +172,7 @@ void TinyTagEditor::runAction()
} }
} }
else else
Statusbar::print("Error while writing tags"); Statusbar::printf("Error while writing tags: %1%", strerror(errno));
} }
if (option > 21) if (option > 21)
m_previous_screen->switchTo(); m_previous_screen->switchTo();