<commit_before>/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
 *     Copyright 2011 Couchbase, Inc.
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

/**
 * This file contains the implementation of the method(s) needed to
 * convert an error constant to a textual representation.K the callback handlers
 *
 * @author <NAME>
 * @todo Localize the function..
 */

#include "internal.h"

LIBCOUCHBASE_API
const char *libcouchbase_strerror(libcouchbase_t instance,
                                  libcouchbase_error_t error) {
    (void)instance;
    switch (error) {
    case LIBCOUCHBASE_SUCCESS:
        return "Success";
    case LIBCOUCHBASE_KEY_ENOENT:
        return "No such key";
    case LIBCOUCHBASE_E2BIG:
        return "Object too big";
    case LIBCOUCHBASE_ENOMEM:
        return "Out of memory";
    case LIBCOUCHBASE_KEY_EEXISTS:
        return "Key already exists";
    case LIBCOUCHBASE_EINVAL:
        return "Invalid arguments";
    case LIBCOUCHBASE_NOT_STORED:
        return "Not stored";
    case LIBCOUCHBASE_DELTA_BADVAL:
        return "Not a number";
    case LIBCOUCHBASE_NOT_MY_VBUCKET:
        return "The vbucket is not located on this server";
    case LIBCOUCHBASE_AUTH_ERROR:
        return "Authentication error";
    case LIBCOUCHBASE_AUTH_CONTINUE:
        return "Continue authentication";
    case LIBCOUCHBASE_ERANGE:
        return "Invalid range";
    case LIBCOUCHBASE_UNKNOWN_COMMAND:
        return "Unknown command";
    case LIBCOUCHBASE_NOT_SUPPORTED:
        return "Not supported";
    case LIBCOUCHBASE_EINTERNAL:
        return "Internal error";
    case LIBCOUCHBASE_EBUSY:
        return "Too busy. Try again later";
    case LIBCOUCHBASE_ETMPFAIL:
        return "Temporary failure. Try again later";
    case LIBCOUCHBASE_LIBEVENT_ERROR:<commit_msg>Changed error text for EEXISTS<commit_after>/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
 *     Copyright 2011 Couchbase, Inc.
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

/**
 * This file contains the implementation of the method(s) needed to
 * convert an error constant to a textual representation.K the callback handlers
 *
 * @author <NAME>
 * @todo Localize the function..
 */

#include "internal.h"

LIBCOUCHBASE_API
const char *libcouchbase_strerror(libcouchbase_t instance,
                                  libcouchbase_error_t error) {
    (void)instance;
    switch (error) {
    case LIBCOUCHBASE_SUCCESS:
        return "Success";
    case LIBCOUCHBASE_KEY_ENOENT:
        return "No such key";
    case LIBCOUCHBASE_E2BIG:
        return "Object too big";
    case LIBCOUCHBASE_ENOMEM:
        return "Out of memory";
    case LIBCOUCHBASE_KEY_EEXISTS:
        return "Key already exists (with a different CAS value)";
    case LIBCOUCHBASE_EINVAL:
        return "Invalid arguments";
    case LIBCOUCHBASE_NOT_STORED:
        return "Not stored";
    case LIBCOUCHBASE_DELTA_BADVAL:
        return "Not a number";
    case LIBCOUCHBASE_NOT_MY_VBUCKET:
        return "The vbucket is not located on this server";
    case LIBCOUCHBASE_AUTH_ERROR:
        return "Authentication error";
    case LIBCOUCHBASE_AUTH_CONTINUE:
        return "Continue authentication";
    case LIBCOUCHBASE_ERANGE:
        return "Invalid range";
    case LIBCOUCHBASE_UNKNOWN_COMMAND:
        return "Unknown command";
    case LIBCOUCHBASE_NOT_SUPPORTED:
        return "Not supported";
    case LIBCOUCHBASE_EINTERNAL:
        return "Internal error";
    case LIBCOUCHBASE_EBUSY:
        return "Too busy. Try again later";
    case LIBCOUCHBASE_ETMPFAIL:
        return "Temporary failure. Try again later";
    case LIBCOUCHBASE_LIBEVENT_ERROR:
{'fraction_non_alphanumeric': 0.07268170426065163, 'fraction_numerical': 0.004594820384294068, 'mean_word_length': 3.010887772194305, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4175986', 'n_tokens_mistral': 1464, 'n_tokens_neox': 1405, 'n_words': 474}