• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

arangodb / velocypack / 3998645281

pending completion
3998645281

Pull #148

github

GitHub
Merge b1e3c924b into 5a28b6413
Pull Request #148: use separate namespace for xxh functions

0 of 5107 relevant lines covered (0.0%)

0.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Exception.cpp
1
////////////////////////////////////////////////////////////////////////////////
2
/// DISCLAIMER
3
///
4
/// Copyright 2014-2020 ArangoDB GmbH, Cologne, Germany
5
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
6
///
7
/// Licensed under the Apache License, Version 2.0 (the "License");
8
/// you may not use this file except in compliance with the License.
9
/// You may obtain a copy of the License at
10
///
11
///     http://www.apache.org/licenses/LICENSE-2.0
12
///
13
/// Unless required by applicable law or agreed to in writing, software
14
/// distributed under the License is distributed on an "AS IS" BASIS,
15
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
/// See the License for the specific language governing permissions and
17
/// limitations under the License.
18
///
19
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
20
///
21
/// @author Max Neunhoeffer
22
/// @author Jan Steemann
23
////////////////////////////////////////////////////////////////////////////////
24

25
#include <ostream>
26

27
#include "velocypack/velocypack-common.h"
28
#include "velocypack/Exception.h"
29

30
using namespace arangodb::velocypack;
31

32
Exception::Exception(ExceptionType type, char const* msg) noexcept
×
33
    : _type(type), _msg(msg) {}
×
34

35
char const* Exception::message(ExceptionType type) noexcept {
×
36
  switch (type) {
×
37
    case InternalError:
×
38
      return "Internal error";
×
39
    case NotImplemented:
×
40
      return "Not implemented";
×
41
    case NoJsonEquivalent:
×
42
      return "Type has no equivalent in JSON";
×
43
    case ParseError:
×
44
      return "Parse error";
×
45
    case UnexpectedControlCharacter:
×
46
      return "Unexpected control character";
×
47
    case DuplicateAttributeName:
×
48
      return "Duplicate attribute name";
×
49
    case IndexOutOfBounds:
×
50
      return "Index out of bounds";
×
51
    case NumberOutOfRange:
×
52
      return "Number out of range";
×
53
    case InvalidUtf8Sequence:
×
54
      return "Invalid UTF-8 sequence";
×
55
    case InvalidAttributePath:
×
56
      return "Invalid attribute path";
×
57
    case InvalidValueType:
×
58
      return "Invalid value type for operation";
×
59
    case NeedCustomTypeHandler:
×
60
      return "Cannot execute operation without custom type handler";
×
61
    case NeedAttributeTranslator:
×
62
      return "Cannot execute operation without attribute translator";
×
63
    case CannotTranslateKey:
×
64
      return "Cannot translate key";
×
65
    case KeyNotFound:
×
66
      return "Key not found";
×
67
    case BadTupleSize:
×
68
      return "Array size does not match tuple size";
×
69
    case TooDeepNesting:
×
70
      return "Too deep nesting in Array/Object";
×
71
    case BuilderNotSealed:
×
72
      return "Builder value not yet sealed";
×
73
    case BuilderNeedOpenObject:
×
74
      return "Need open Object";
×
75
    case BuilderNeedOpenArray:
×
76
      return "Need open Array";
×
77
    case BuilderNeedSubvalue:
×
78
      return "Need subvalue in current Object or Array";
×
79
    case BuilderNeedOpenCompound:
×
80
      return "Need open compound value (Array or Object)";
×
81
    case BuilderUnexpectedType:
×
82
      return "Unexpected type";
×
83
    case BuilderUnexpectedValue:
×
84
      return "Unexpected value";
×
85
    case BuilderExternalsDisallowed:
×
86
      return "Externals are not allowed in this configuration";
×
87
    case BuilderKeyAlreadyWritten:
×
88
      return "The key of the next key/value pair is already written";
×
89
    case BuilderKeyMustBeString:
×
90
      return "The key of the next key/value pair must be a string";
×
91
    case BuilderCustomDisallowed:
×
92
      return "Custom types are not allowed in this configuration";
×
93
    case BuilderTagsDisallowed:
×
94
      return "Tagged types are not allowed in this configuration";
×
95
    case BuilderBCDDisallowed:
×
96
      return "BCD types are not allowed in this configuration";
×
97

98
    case ValidatorInvalidType:
×
99
      return "Invalid type found in binary data";
×
100
    case ValidatorInvalidLength:
×
101
      return "Invalid length found in binary data";
×
102

103
    case UnknownError:
×
104
    default:
105
      return "Unknown error";
×
106
  }
107
}
108

109
std::ostream& operator<<(std::ostream& stream, Exception const* ex) {
×
110
  stream << "[Exception " << ex->what() << "]";
×
111
  return stream;
×
112
}
113

114
std::ostream& operator<<(std::ostream& stream, Exception const& ex) {
×
115
  return operator<<(stream, &ex);
×
116
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc