2 Copyright 2020 Google LLC
4 Use of this source code is governed by a BSD-style
5 license that can be found in the LICENSE file or at
6 https://developers.google.com/open-source/licenses/bsd
9 #include "reftable-error.h"
13 const char *reftable_error_str(int err
)
17 case REFTABLE_IO_ERROR
:
19 case REFTABLE_FORMAT_ERROR
:
20 return "corrupt reftable file";
21 case REFTABLE_NOT_EXIST_ERROR
:
22 return "file does not exist";
23 case REFTABLE_LOCK_ERROR
:
24 return "data is outdated";
25 case REFTABLE_API_ERROR
:
26 return "misuse of the reftable API";
27 case REFTABLE_ZLIB_ERROR
:
28 return "zlib failure";
29 case REFTABLE_NAME_CONFLICT
:
30 return "file/directory conflict";
31 case REFTABLE_EMPTY_TABLE_ERROR
:
32 return "wrote empty table";
33 case REFTABLE_REFNAME_ERROR
:
34 return "invalid refname";
35 case REFTABLE_ENTRY_TOO_BIG_ERROR
:
36 return "entry too large";
38 return "general error";
40 snprintf(buf
, sizeof(buf
), "unknown error code %d", err
);