4 #include "polyplib-error.h"
5 #include "native-common.h"
7 static const char* const errortab
[PA_ERROR_MAX
] = {
9 [PA_ERROR_ACCESS
] = "Access denied",
10 [PA_ERROR_COMMAND
] = "Unknown command",
11 [PA_ERROR_INVALID
] = "Invalid argument",
12 [PA_ERROR_EXIST
] = "Entity exists",
13 [PA_ERROR_NOENTITY
] = "No such entity",
14 [PA_ERROR_CONNECTIONREFUSED
] = "Connection refused",
15 [PA_ERROR_PROTOCOL
] = "Protocol corrupt",
16 [PA_ERROR_TIMEOUT
] = "Timeout",
17 [PA_ERROR_AUTHKEY
] = "Not authorization key",
18 [PA_ERROR_INTERNAL
] = "Internal error",
19 [PA_ERROR_CONNECTIONTERMINATED
] = "Connection terminated",
20 [PA_ERROR_KILLED
] = "Entity killed",
23 const char*pa_strerror(uint32_t error
) {
24 if (error
>= PA_ERROR_MAX
)
27 return errortab
[error
];