Sourcemeta Core 0.0.0
Loading...
Searching...
No Matches
uri_error.h
1#ifndef SOURCEMETA_CORE_URI_ERROR_H_
2#define SOURCEMETA_CORE_URI_ERROR_H_
3
4#ifndef SOURCEMETA_CORE_URI_EXPORT
5#include <sourcemeta/core/uri_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_URI_EXPORT URIParseError : public Error {
19public:
21 URIParseError(const std::uint64_t column) noexcept
22 : Error{"The input is not a valid URI"}, 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
35class SOURCEMETA_CORE_URI_EXPORT URIError : public Error {
36public:
39};
40
41SOURCEMETA_CORE_ERROR_WARNINGS_POP
42
43} // namespace sourcemeta::core
44
45#endif
auto message() const noexcept -> StaticString
Definition error_base.h:78
Error(const StaticString message) noexcept
Construct the error given its message.
Definition error_base.h:84
Definition text_static_string.h:20
URIError(const StaticString message) noexcept
Construct an error with the given message.
Definition uri_error.h:38
auto column() const noexcept -> std::uint64_t
Get the column number of the error.
Definition uri_error.h:25
URIParseError(const std::uint64_t column) noexcept
Construct an error from the column at which parsing failed.
Definition uri_error.h:21