# HG changeset patch # User Matti Hamalainen # Date 1455520045 -7200 # Node ID 9ff4f6da3db8dc9852ee234e19e78846574fb7ee # Parent 09ca9d9a87108805738653e1899cd4fb4f559bd8 Improve error handling. diff -r 09ca9d9a8710 -r 9ff4f6da3db8 sidinfo.c --- a/sidinfo.c Mon Feb 15 06:07:50 2016 +0200 +++ b/sidinfo.c Mon Feb 15 09:07:25 2016 +0200 @@ -639,14 +639,17 @@ th_ioctx *ctx; if ((ctx = th_io_fopen(&th_stdio_io_ops, setSLDBPath, "r")) == NULL) { - THERR("Could not open SLDB '%s'.\n", setSLDBPath); + THERR("Could not open SLDB '%s'.\n", + setSLDBPath); goto out; } + THMSG(0, "Reading SLDB.\n"); if ((sidSLDB = si_sldb_new()) == NULL || - si_sldb_read(ctx, sidSLDB) != THERR_OK) + (ret = si_sldb_read(ctx, sidSLDB)) != THERR_OK) { - THERR("Error parsing SLDB.\n"); + THERR("Error parsing SLDB: %d, %s\n", + ret, th_error_str(ret)); th_io_close(ctx); goto out; } @@ -654,8 +657,8 @@ if ((ret = si_sldb_build_index(sidSLDB)) != THERR_OK) { - THERR("Error building SLDB index: %s.\n", - th_error_str(ret)); + THERR("Error building SLDB index: %d, %s.\n", + ret, th_error_str(ret)); goto out; } }