1# basic_json::out_of_range
2
3```cpp
4class out_of_range : public exception;
5```
6
7This exception is thrown in case a library function is called on an input parameter that exceeds the expected range, for
8instance in case of array indices or nonexisting object keys.
9
10Exceptions have ids 4xx.
11
12```plantuml
13std::exception <|-- basic_json::exception
14basic_json::exception <|-- basic_json::parse_error
15basic_json::exception <|-- basic_json::invalid_iterator
16basic_json::exception <|-- basic_json::type_error
17basic_json::exception <|-- basic_json::out_of_range
18basic_json::exception <|-- basic_json::other_error
19
20interface std::exception {}
21
22class basic_json::exception {
23    + const int id
24    + const char* what() const
25}
26
27class basic_json::parse_error {
28    + const std::size_t byte
29}
30
31class basic_json::out_of_range #FFFF00 {}
32```
33
34## Member functions
35
36- **what** - returns explanatory string
37
38## Member variables
39
40- **id** - the id of the exception
41
42## Example
43
44??? example
45
46    The following code shows how a `out_of_range` exception can be caught.
47
48    ```cpp
49    --8<-- "examples/out_of_range.cpp"
50    ```
51
52    Output:
53
54    ```json
55    --8<-- "examples/out_of_range.output"
56    ```
57
58## Version history
59
60- Since version 3.0.0.
61