1 /* Copyright 2016 OpenMarket Ltd
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #include "olm/error.h"
18 static const char * ERRORS[] = {
21 "OUTPUT_BUFFER_TOO_SMALL",
22 "BAD_MESSAGE_VERSION",
28 "UNKNOWN_PICKLE_VERSION",
31 "UNKNOWN_MESSAGE_INDEX",
32 "BAD_LEGACY_ACCOUNT_PICKLE",
34 "OLM_INPUT_BUFFER_TOO_SMALL",
35 "OLM_SAS_THEIR_KEY_NOT_SET",
36 "OLM_PICKLE_EXTRA_DATA"
39 const char * _olm_error_to_string(enum OlmErrorCode error)
41 if (error < (sizeof(ERRORS)/sizeof(ERRORS[0]))) {
44 return "UNKNOWN_ERROR";