Better error message if the output tileset already exists

This commit is contained in:
Eric Fischer
2018-12-13 11:20:06 -08:00
parent 45fbdf43c5
commit 28f773a933
7 changed files with 13 additions and 7 deletions
+2 -1
View File
@@ -45,7 +45,8 @@ sqlite3 *mbtiles_open(char *dbname, char **argv, int forcetable) {
exit(EXIT_FAILURE);
}
if (sqlite3_exec(outdb, "CREATE TABLE metadata (name text, value text);", NULL, NULL, &err) != SQLITE_OK) {
fprintf(stderr, "%s: create metadata table: %s\n", argv[0], err);
fprintf(stderr, "%s: Tileset \"%s\" already exists. You can use --force if you want to delete the old tileset.\n", argv[0], dbname);
fprintf(stderr, "%s: %s\n", argv[0], err);
if (!forcetable) {
exit(EXIT_FAILURE);
}