1 /* The Ruby interface to the notmuch mail library
3 * Copyright © 2010, 2011 Ali Polatel
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see https://www.gnu.org/licenses/ .
18 * Author: Ali Polatel <alip@exherbo.org>
24 notmuch_rb_status_raise (notmuch_status_t status)
27 case NOTMUCH_STATUS_SUCCESS:
28 case NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID:
30 case NOTMUCH_STATUS_OUT_OF_MEMORY:
31 rb_raise (notmuch_rb_eMemoryError, "out of memory");
32 case NOTMUCH_STATUS_READ_ONLY_DATABASE:
33 rb_raise (notmuch_rb_eReadOnlyError, "read-only database");
34 case NOTMUCH_STATUS_XAPIAN_EXCEPTION:
35 rb_raise (notmuch_rb_eXapianError, "xapian exception");
36 case NOTMUCH_STATUS_FILE_ERROR:
37 rb_raise (notmuch_rb_eFileError, "failed to read/write file");
38 case NOTMUCH_STATUS_FILE_NOT_EMAIL:
39 rb_raise (notmuch_rb_eFileNotEmailError, "file not email");
40 case NOTMUCH_STATUS_NULL_POINTER:
41 rb_raise (notmuch_rb_eNullPointerError, "null pointer");
42 case NOTMUCH_STATUS_TAG_TOO_LONG:
43 rb_raise (notmuch_rb_eTagTooLongError, "tag too long");
44 case NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW:
45 rb_raise (notmuch_rb_eUnbalancedFreezeThawError, "unbalanced freeze/thaw");
46 case NOTMUCH_STATUS_UNBALANCED_ATOMIC:
47 rb_raise (notmuch_rb_eUnbalancedAtomicError, "unbalanced atomic");
49 rb_raise (notmuch_rb_eBaseError, "unknown notmuch error");