mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-12-16 03:08:52 +08:00
doc: update exception section in README (fix #107)
This commit is contained in:
12
README.md
12
README.md
@@ -1424,7 +1424,7 @@ const toml::source_location loc = v.location();
|
|||||||
|
|
||||||
## Exceptions
|
## Exceptions
|
||||||
|
|
||||||
All the exceptions thrown by toml11 inherits `toml::exception` that inherits
|
The following `exception` classes inherits `toml::exception` that inherits
|
||||||
`std::exception`.
|
`std::exception`.
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
@@ -1451,6 +1451,16 @@ struct exception : public std::exception
|
|||||||
|
|
||||||
It represents where the error occurs.
|
It represents where the error occurs.
|
||||||
|
|
||||||
|
`syntax_error` will be thrown from `toml::parse` and `_toml` literal.
|
||||||
|
`type_error` will be thrown from `toml::get/find`, `toml::value::as_xxx()`, and
|
||||||
|
other functions that takes a content inside of `toml::value`.
|
||||||
|
|
||||||
|
Note that, currently, from `toml::value::at()` and `toml::find(value, key)`
|
||||||
|
may throw an `std::out_of_range` that does not inherits `toml::exception`.
|
||||||
|
|
||||||
|
Also, in some cases, most likely in the file open error, it will throw an
|
||||||
|
`std::runtime_error`.
|
||||||
|
|
||||||
## Colorize Error Messages
|
## Colorize Error Messages
|
||||||
|
|
||||||
By defining `TOML11_COLORIZE_ERROR_MESSAGE`, the error messages from
|
By defining `TOML11_COLORIZE_ERROR_MESSAGE`, the error messages from
|
||||||
|
|||||||
Reference in New Issue
Block a user