aboutsummaryrefslogtreecommitdiffstats
path: root/test/dump_rva2.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-10 18:02:44 +0200
committerMax Kellermann <max@duempel.org>2013-09-04 18:14:22 +0200
commit29030b54c98b0aee65fbc10ebf7ba36bed98c02c (patch)
tree79766830b55ebca38ddbce84d8d548227eedb69e /test/dump_rva2.cxx
parentc9fcc7f14860777458153eb2d13c773ccfa1daa2 (diff)
downloadmpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.tar.gz
mpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.tar.xz
mpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.zip
util/Error: new error passing library
Replaces GLib's GError.
Diffstat (limited to '')
-rw-r--r--test/dump_rva2.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/test/dump_rva2.cxx b/test/dump_rva2.cxx
index 9dbb018d6..95a55eb43 100644
--- a/test/dump_rva2.cxx
+++ b/test/dump_rva2.cxx
@@ -23,6 +23,7 @@
#include "replay_gain_info.h"
#include "conf.h"
#include "Tag.hxx"
+#include "util/Error.hxx"
#include <id3tag.h>
@@ -51,8 +52,6 @@ Tag::~Tag() {}
int main(int argc, char **argv)
{
- GError *error = NULL;
-
#ifdef HAVE_LOCALE_H
/* initialize locale */
setlocale(LC_CTYPE,"");
@@ -65,12 +64,12 @@ int main(int argc, char **argv)
const char *path = argv[1];
- struct id3_tag *tag = tag_id3_load(path, &error);
+ Error error;
+ struct id3_tag *tag = tag_id3_load(path, error);
if (tag == NULL) {
- if (error != NULL) {
- g_printerr("%s\n", error->message);
- g_error_free(error);
- } else
+ if (error.IsDefined())
+ g_printerr("%s\n", error.GetMessage());
+ else
g_printerr("No ID3 tag found\n");
return EXIT_FAILURE;