LibQuicR
errors.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) 2024 Cisco Systems
2 // SPDX-License-Identifier: BSD-2-Clause
3 
4 #pragma once
5 
6 #include "quicr/attributes.h"
7 
8 #include <cstdint>
9 #include <optional>
10 #include <string>
11 
12 namespace quicr {
13 
19  template<typename E>
20  struct Error
21  {
23 
24  std::optional<std::string> error_reason;
25 
26  std::optional<Redirect> redirect = std::nullopt;
27  };
28 
32  enum class ErrorCode : std::uint64_t
33  {
34  kInternalError = 0x0,
35  kUnauthorized = 0x1,
36  kTimeout = 0x2,
37  kNotSupported = 0x3,
38  kMalformedAuthToken = 0x4,
39  kExpiredAuthToken = 0x5,
40  kGoingAway = 0x6,
41  kDoesNotExist = 0x10,
42  kInvalidRange = 0x11,
43  kMalformedTrack = 0x12,
44  kDuplicateSubscription = 0x19,
45  kUninterested = 0x20,
46  kPrefixOverlap = 0x30,
48  kRedirect = 0x34,
49  };
50 }
Definition: attributes.h:13
ErrorCode
MOQT error code, as carried by REQUEST_ERROR.
Definition: errors.h:33
@ kUnauthorized
The requester is not authorized for the operation.
@ kGoingAway
The request is going away.
@ kDoesNotExist
The requested resource does not exist.
@ kExpiredAuthToken
An authorization token has expired.
@ kMalformedAuthToken
An authorization token is syntactically invalid.
@ kRedirect
A request should redirect with the given redirect info.
@ kInvalidRange
The requested object range is invalid.
@ kTimeout
The request could not be completed before its deadline.
@ kInvalidJoiningRequestId
A joining fetch references an invalid request identifier.
@ kPrefixOverlap
A namespace prefix overlaps an existing request incompatibly.
@ kUninterested
The endpoint is no longer interested in the request.
@ kNotSupported
The requested operation or feature is unsupported.
@ kDuplicateSubscription
An equivalent subscription already exists.
@ kMalformedTrack
The supplied track name or properties are malformed.
@ kInternalError
The endpoint encountered an unspecified internal failure.
A rejected result, holding why the request was rejected.
Definition: errors.h:21
E reason_code
Machine-readable reason the operation was rejected.
Definition: errors.h:22
std::optional< Redirect > redirect
Optional redirect path for request.
Definition: errors.h:26
std::optional< std::string > error_reason
Optional human-readable explanation suitable for diagnostics.
Definition: errors.h:24