Blame


1 4027f31a 2017-11-04 stsp
2 4027f31a 2017-11-04 stsp /* Error codes */
3 4027f31a 2017-11-04 stsp #define GOT_ERR_UNKNOWN 0x0000
4 4027f31a 2017-11-04 stsp #define GOT_ERR_NO_MEM 0x0001
5 4027f31a 2017-11-04 stsp #define GOT_ERR_NOT_GIT_REPO 0x0002
6 4027f31a 2017-11-04 stsp #define GOT_ERR_NOT_ABSPATH 0x0003
7 4027f31a 2017-11-04 stsp #define GOT_ERR_BAD_PATH 0x0004
8 4027f31a 2017-11-04 stsp #define GOT_ERR_NOT_REF 0x0005
9 4027f31a 2017-11-04 stsp
10 4027f31a 2017-11-04 stsp static const struct got_error {
11 4027f31a 2017-11-04 stsp int code;
12 4027f31a 2017-11-04 stsp const char *msg;
13 4027f31a 2017-11-04 stsp } got_errors[] = {
14 4027f31a 2017-11-04 stsp { GOT_ERR_UNKNOWN, "unknown error" },
15 4027f31a 2017-11-04 stsp { GOT_ERR_NO_MEM, "out of memory" },
16 4027f31a 2017-11-04 stsp { GOT_ERR_NOT_GIT_REPO, "no git repository found" },
17 4027f31a 2017-11-04 stsp { GOT_ERR_NOT_ABSPATH, "absolute path expected" },
18 4027f31a 2017-11-04 stsp { GOT_ERR_BAD_PATH, "bad path" },
19 4027f31a 2017-11-04 stsp { GOT_ERR_NOT_REF, "no such reference found" },
20 4027f31a 2017-11-04 stsp };
21 4027f31a 2017-11-04 stsp
22 4027f31a 2017-11-04 stsp const struct got_error * got_error(int code);