Sourcemeta Core 0.0.0
Loading...
Searching...
No Matches
jsonpath_error.h
1#ifndef SOURCEMETA_CORE_JSONPATH_ERROR_H_
2#define SOURCEMETA_CORE_JSONPATH_ERROR_H_
3
4#ifndef SOURCEMETA_CORE_JSONPATH_EXPORT
5#include <sourcemeta/core/jsonpath_export.h>
6#endif
7
8#include <sourcemeta/core/error.h>
9
10#include <cstdint> // std::uint64_t
11
12namespace sourcemeta::core {
13
14SOURCEMETA_CORE_ERROR_WARNINGS_PUSH
15
18class SOURCEMETA_CORE_JSONPATH_EXPORT JSONPathParseError : public Error {
19public:
21 JSONPathParseError(const std::uint64_t column) noexcept
22 : Error{"The input is not a valid JSON Path query"}, column_{column} {}
23
25 [[nodiscard]] auto column() const noexcept -> std::uint64_t {
26 return this->column_;
27 }
28
29private:
30 std::uint64_t column_;
31};
32
33SOURCEMETA_CORE_ERROR_WARNINGS_POP
34
35} // namespace sourcemeta::core
36
37#endif
Error(const StaticString message) noexcept
Construct the error given its message.
Definition error_base.h:84
auto column() const noexcept -> std::uint64_t
Get the column number of the error.
Definition jsonpath_error.h:25
JSONPathParseError(const std::uint64_t column) noexcept
Construct an error given the column number where parsing failed.
Definition jsonpath_error.h:21