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
10 #include "reftable-error.h"
14 const char *reftable_error_str(int err
)
18 case REFTABLE_IO_ERROR
:
20 case REFTABLE_FORMAT_ERROR
:
21 return "corrupt reftable file";
22 case REFTABLE_NOT_EXIST_ERROR
:
23 return "file does not exist";
24 case REFTABLE_LOCK_ERROR
:
25 return "data is outdated";
26 case REFTABLE_API_ERROR
:
27 return "misuse of the reftable API";
28 case REFTABLE_ZLIB_ERROR
:
29 return "zlib failure";
30 case REFTABLE_NAME_CONFLICT
:
31 return "file/directory conflict";
32 case REFTABLE_EMPTY_TABLE_ERROR
:
33 return "wrote empty table";
34 case REFTABLE_REFNAME_ERROR
:
35 return "invalid refname";
36 case REFTABLE_ENTRY_TOO_BIG_ERROR
:
37 return "entry too large";
39 return "general error";
41 snprintf(buf
, sizeof(buf
), "unknown error code %d", err
);