aboutsummaryrefslogtreecommitdiff
path: root/notmuch-new.c
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2022-12-27 13:08:47 -0400
committerDavid Bremner <david@tethera.net>2023-02-20 09:22:32 -0400
commit09f2ad8e853375930c63bca847f623bc722b9cc0 (patch)
treec83851be016bd5ea542ac8b36f507b8068d5e83e /notmuch-new.c
parent4e6c6c8aac7f581448df525abd09b85c08358dd3 (diff)
lib: add better diagnostics for over long filenames.
Previously we just crashed with an internal error. With this change, the caller can handle it better. Update notmuch-new so that it doesn't crash with "unknown error code" because of this change.
Diffstat (limited to 'notmuch-new.c')
-rw-r--r--notmuch-new.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/notmuch-new.c b/notmuch-new.c
index 346e6469..4a53e3eb 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -413,6 +413,10 @@ add_file (notmuch_database_t *notmuch, const char *filename,
case NOTMUCH_STATUS_FILE_NOT_EMAIL:
fprintf (stderr, "Note: Ignoring non-mail file: %s\n", filename);
break;
+ case NOTMUCH_STATUS_PATH_ERROR:
+ fprintf (stderr, "Note: Ignoring non-indexable path: %s\n", filename);
+ (void) print_status_database ("add_file", notmuch, status);
+ break;
case NOTMUCH_STATUS_FILE_ERROR:
/* Someone renamed/removed the file between scandir and now. */
state->vanished_files++;