Skip to content

Commit ae220f2

Browse files
for openziti/ziti#3437 adds edge client structured errors (#844)
* for openziti/ziti#3437 adds edge client structured errors - adds a header specifically for structured errors - used in ziti/router code
1 parent f0c1552 commit ae220f2

File tree

4 files changed

+58
-45
lines changed

4 files changed

+58
-45
lines changed

pb/edge_client_pb/edge_client.pb.go

Lines changed: 42 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pb/edge_client_pb/edge_client.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ enum HeaderId {
8585
XgressAddress = 1030;
8686
InspectRequestedValues = 1031;
8787
SupportsPostureChecks = 1032;
88+
StructuredError = 1033;
8889
}
8990

9091
enum Error {
@@ -100,6 +101,7 @@ enum Error {
100101
InvalidPrecedence = 9;
101102
InvalidCost = 10;
102103
EncryptionDataMissing = 11;
104+
InvalidApiSessionType = 12;
103105
}
104106

105107
enum PrecedenceValue {

ziti/edge/messages.go

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,22 @@ const (
112112
XgressAddressHeader = int32(edge_client_pb.HeaderId_XgressAddress)
113113
InspectRequestValuesHeader = int32(edge_client_pb.HeaderId_InspectRequestedValues)
114114
SupportsPostureChecksHeader = int32(edge_client_pb.HeaderId_SupportsPostureChecks)
115+
StructuredError = int32(edge_client_pb.HeaderId_StructuredError)
115116
)
116117

117118
const (
118-
ErrorCodeInternal = int32(edge_client_pb.Error_Internal)
119-
ErrorCodeInvalidApiSession = int32(edge_client_pb.Error_InvalidApiSession)
120-
ErrorCodeInvalidSession = int32(edge_client_pb.Error_InvalidSession)
121-
ErrorCodeWrongSessionType = int32(edge_client_pb.Error_WrongSessionType)
122-
ErrorCodeInvalidEdgeRouterForSession = int32(edge_client_pb.Error_InvalidEdgeRouterForSession)
123-
ErrorCodeInvalidService = int32(edge_client_pb.Error_InvalidService)
124-
ErrorCodeTunnelingNotEnabled = int32(edge_client_pb.Error_TunnelingNotEnabled)
125-
ErrorCodeInvalidTerminator = int32(edge_client_pb.Error_InvalidTerminator)
126-
ErrorCodeInvalidPrecedence = int32(edge_client_pb.Error_InvalidPrecedence)
127-
ErrorCodeInvalidCost = int32(edge_client_pb.Error_InvalidCost)
128-
ErrorCodeEncryptionDataMissing = int32(edge_client_pb.Error_EncryptionDataMissing)
119+
ErrorCodeInternal = uint32(edge_client_pb.Error_Internal)
120+
ErrorCodeInvalidApiSession = uint32(edge_client_pb.Error_InvalidApiSession)
121+
ErrorCodeInvalidSession = uint32(edge_client_pb.Error_InvalidSession)
122+
ErrorCodeWrongSessionType = uint32(edge_client_pb.Error_WrongSessionType)
123+
ErrorCodeInvalidEdgeRouterForSession = uint32(edge_client_pb.Error_InvalidEdgeRouterForSession)
124+
ErrorCodeInvalidService = uint32(edge_client_pb.Error_InvalidService)
125+
ErrorCodeTunnelingNotEnabled = uint32(edge_client_pb.Error_TunnelingNotEnabled)
126+
ErrorCodeInvalidTerminator = uint32(edge_client_pb.Error_InvalidTerminator)
127+
ErrorCodeInvalidPrecedence = uint32(edge_client_pb.Error_InvalidPrecedence)
128+
ErrorCodeInvalidCost = uint32(edge_client_pb.Error_InvalidCost)
129+
ErrorCodeEncryptionDataMissing = uint32(edge_client_pb.Error_EncryptionDataMissing)
130+
ErrorCodeInvalidApiSessionType = uint32(edge_client_pb.Error_InvalidApiSessionType)
129131
)
130132

131133
const (

ziti/sdkinfo/build_info.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)