summaryrefslogtreecommitdiffstats
path: root/web/server/h2o/libh2o/deps/libyrmcds/strerror.c
blob: e9359b5964464e8d2696a26dba150f75df35ff00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// (C) 2013-2015 Cybozu.

#include "yrmcds.h"

const char* yrmcds_strerror(yrmcds_error e) {
    switch( e ) {
    case YRMCDS_OK:
        return "OK";
    case YRMCDS_SYSTEM_ERROR:
        return "Check errno for details";
    case YRMCDS_BAD_ARGUMENT:
        return "Bad argument";
    case YRMCDS_NOT_RESOLVED:
        return "Host not found";
    case YRMCDS_TIMEOUT:
        return "Timeout";
    case YRMCDS_DISCONNECTED:
        return "Connection was reset by peer";
    case YRMCDS_OUT_OF_MEMORY:
        return "Failed to allocate memory";
    case YRMCDS_COMPRESS_FAILED:
        return "Failed to compress data";
    case YRMCDS_PROTOCOL_ERROR:
        return "Received malformed packet";
    case YRMCDS_NOT_IMPLEMENTED:
        return "Not implemented";
    case YRMCDS_IN_BINARY:
        return "Connection is fixed for binary protocol";
    case YRMCDS_BAD_KEY:
        return "Bad key";
    default:
        return "Unknown error";
    };
}