#include "err.h"

const char *
KEKSErr2Str(const enum KEKSErr err)
{
    switch (err) {
    case KEKSErrInvalid:
        return "Invalid";
    case KEKSErrNo:
        return "No";
    case KEKSErrNotEnough:
        return "NotEnough";
    case KEKSErrUnknownType:
        return "UnknownType";
    case KEKSErrLenTooBig:
        return "LenTooBig";
    case KEKSErrBadUTF8:
        return "BadUTF8";
    case KEKSErrIntNonBin:
        return "IntNonBin";
    case KEKSErrIntNonMinimal:
        return "IntNonMinimal";
    case KEKSErrBlobBadAtom:
        return "BlobBadAtom";
    case KEKSErrBlobBadChunkLen:
        return "BlobBadChunkLen";
    case KEKSErrTAI64TooBig:
        return "TAI64TooBig";
    case KEKSErrTAI64BadNsec:
        return "TAI64BadNsec";
    case KEKSErrTAI64BadAsec:
        return "TAI64BadAsec";
    case KEKSErrTAI64InPast:
        return "TAI64InPast";
    case KEKSErrTAI64IsLeap:
        return "TAI64IsLeap";
    case KEKSErrTAI64NonMinimal:
        return "TAI64NonMinimal";
    case KEKSErrMapBadKey:
        return "MapBadKey";
    case KEKSErrMapUnordered:
        return "MapUnordered";
    case KEKSErrNoMem:
        return "NoMem";
    case KEKSErrUnsatisfiedSchema:
        return "UnsatisfiedSchema";
    case KEKSErrDeepRecursion:
        return "DeepRecursion";
    case KEKSErrUnexpectedEOC:
        return "UnexpectedEOC";
    case KEKSErrBadMagic:
        return "BadMagic";
    case KEKSErrFloatNonInt:
        return "FloatNonInt";
    default:
        return "unknown";
    }
}
