proxygen
ProxygenErrorEnum.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
11 
12 #define PROXYGEN_ERROR_STR(error) #error
13 
14 namespace {
15  static const char* errorStrings[] = {
17  };
18 }
19 
20 namespace proxygen {
21 
22 static_assert(kErrorMax < 1 << PROXYGEN_ERROR_BITSIZE,
23  "ProxygenError overflow");
24 
26  if (error < kErrorNone || error >= kErrorMax) {
27  return errorStrings[kErrorMax];
28  } else {
29  return errorStrings[error];
30  }
31 }
32 
33 const char* getErrorStringByIndex(int i) {
34  return errorStrings[i];
35 }
36 
37 }
#define PROXYGEN_ERROR_BITSIZE
#define PROXYGEN_ERROR_STR(error)
requires And< SemiMovable< VN >... > &&SemiMovable< E > auto error(E e)
Definition: error.h:48
const char * getErrorStringByIndex(int i)
#define PROXYGEN_ERROR_GEN(x)
const char * getErrorString(ProxygenError error)