Update dependencies

This commit is contained in:
eleksir
2024-07-24 22:57:56 +03:00
parent ac243bf4fd
commit 00257b8e6c
729 changed files with 47714 additions and 29066 deletions

View File

@@ -24,10 +24,42 @@ var _ = math.Inf
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// MessageType encodes information regarding the interpretation of an
// error's message string.
type MessageType int32
const (
// Keeping zero value as default for backwards compatibility.
// PREFIX is a message that should be prepended to its cause.
MessageType_PREFIX MessageType = 0
// FULL_MESSAGE is a complete error message that can be displayed
// without its cause.
MessageType_FULL_MESSAGE MessageType = 1
)
var MessageType_name = map[int32]string{
0: "PREFIX",
1: "FULL_MESSAGE",
}
var MessageType_value = map[string]int32{
"PREFIX": 0,
"FULL_MESSAGE": 1,
}
func (x MessageType) String() string {
return proto.EnumName(MessageType_name, int32(x))
}
func (MessageType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_ddc818d0729874b8, []int{0}
}
// EncodedError is the wire-encodable representation
// of an error (or error cause chain).
type EncodedError struct {
// Types that are valid to be assigned to Error:
//
// *EncodedError_Leaf
// *EncodedError_Wrapper
Error isEncodedError_Error `protobuf_oneof:"error"`
@@ -108,7 +140,7 @@ func (*EncodedError) XXX_OneofWrappers() []interface{} {
}
// EncodedErrorLeaf is the wire-encodable representation
// of an error leaf.
// of an error leaf or a multi-cause wrapper from go 1.20+
type EncodedErrorLeaf struct {
// The main error message (mandatory), that can be printed to human
// users and may contain PII. This contains the value of the leaf
@@ -116,6 +148,11 @@ type EncodedErrorLeaf struct {
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
// The error details.
Details EncodedErrorDetails `protobuf:"bytes,2,opt,name=details,proto3" json:"details"`
// multierror_causes is a list of errors that contain the causal tree
// of this leaf. If this field is not empty, then this leaf encodes
// an error from go 1.20 or later that encodes multiple causes in its
// chain.
MultierrorCauses []*EncodedError `protobuf:"bytes,3,rep,name=multierror_causes,json=multierrorCauses,proto3" json:"multierror_causes,omitempty"`
}
func (m *EncodedErrorLeaf) Reset() { *m = EncodedErrorLeaf{} }
@@ -210,17 +247,23 @@ var xxx_messageInfo_EncodedErrorDetails proto.InternalMessageInfo
type EncodedWrapper struct {
// The cause error. Mandatory.
Cause EncodedError `protobuf:"bytes,1,opt,name=cause,proto3" json:"cause"`
// The wrapper message prefix (which may be empty). This
// isbprinted before the cause's own message when
// constructing a full message. This may contain PII.
// The wrapper message. This could either be a full error message
// that can be printed independently, or a (potentially empty) prefix
// which is printed before the cause's own message to construct the
// full message. This may contain PII.
//
// This is extracted automatically:
//
// - for wrappers that have a registered encoder,
// - otherwise, when the wrapper's Error() has its cause's Error() as suffix.
MessagePrefix string `protobuf:"bytes,2,opt,name=message_prefix,json=messagePrefix,proto3" json:"message_prefix,omitempty"`
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
// The error details.
Details EncodedErrorDetails `protobuf:"bytes,3,opt,name=details,proto3" json:"details"`
// message_type encodes the interpretation of `message`. Prior
// versions will not set this field and it will be left as `PREFIX`.
// This retains backwards compatibility since the new behavior is
// only enabled when this enum is set to `FULL_MESSAGE`.
MessageType MessageType `protobuf:"varint,4,opt,name=message_type,json=messageType,proto3,enum=cockroach.errorspb.MessageType" json:"message_type,omitempty"`
}
func (m *EncodedWrapper) Reset() { *m = EncodedWrapper{} }
@@ -382,6 +425,7 @@ func (m *ErrnoPayload) XXX_DiscardUnknown() {
var xxx_messageInfo_ErrnoPayload proto.InternalMessageInfo
func init() {
proto.RegisterEnum("cockroach.errorspb.MessageType", MessageType_name, MessageType_value)
proto.RegisterType((*EncodedError)(nil), "cockroach.errorspb.EncodedError")
proto.RegisterType((*EncodedErrorLeaf)(nil), "cockroach.errorspb.EncodedErrorLeaf")
proto.RegisterType((*EncodedErrorDetails)(nil), "cockroach.errorspb.EncodedErrorDetails")
@@ -394,46 +438,51 @@ func init() {
func init() { proto.RegisterFile("errorspb/errors.proto", fileDescriptor_ddc818d0729874b8) }
var fileDescriptor_ddc818d0729874b8 = []byte{
// 624 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0x41, 0x6f, 0xd3, 0x4c,
0x10, 0xb5, 0xbf, 0xa4, 0x4d, 0x32, 0x49, 0xfa, 0x95, 0xa5, 0x48, 0x6e, 0x45, 0xdd, 0x34, 0x80,
0xa8, 0x2a, 0x70, 0x24, 0x38, 0x20, 0x21, 0x84, 0x44, 0x45, 0x45, 0x0f, 0x50, 0x2a, 0x53, 0x09,
0x89, 0x8b, 0xb5, 0x49, 0xc6, 0xee, 0xaa, 0xb6, 0xd7, 0xda, 0x75, 0x44, 0xfd, 0x2f, 0x90, 0xf8,
0x3f, 0x9c, 0x7b, 0xec, 0xb1, 0x27, 0x04, 0xa9, 0xf8, 0x17, 0x1c, 0x90, 0x77, 0xbd, 0x6d, 0x0a,
0x15, 0x3d, 0x70, 0x1b, 0xbf, 0x79, 0xe3, 0xf7, 0x3c, 0x6f, 0x0c, 0xb7, 0x50, 0x08, 0x2e, 0x64,
0x36, 0x1c, 0xe8, 0xc2, 0xcb, 0x04, 0xcf, 0x39, 0x21, 0x23, 0x3e, 0x3a, 0x14, 0x9c, 0x8e, 0x0e,
0x3c, 0x43, 0x58, 0x59, 0x8e, 0x38, 0x8f, 0x62, 0x1c, 0x28, 0xc6, 0x70, 0x12, 0x0e, 0x68, 0x5a,
0x68, 0xfa, 0xca, 0x52, 0xc4, 0x23, 0xae, 0xca, 0x41, 0x59, 0x69, 0xb4, 0xff, 0xd9, 0x86, 0xce,
0x76, 0x3a, 0xe2, 0x63, 0x1c, 0x6f, 0x97, 0x2f, 0x21, 0x4f, 0xa1, 0x1e, 0x23, 0x0d, 0x1d, 0xbb,
0x67, 0x6f, 0xb4, 0x1f, 0xdd, 0xf5, 0xfe, 0x14, 0xf1, 0x66, 0xf9, 0xaf, 0x91, 0x86, 0x3b, 0x96,
0xaf, 0x66, 0xc8, 0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 0x93, 0xfb, 0x1a, 0x20, 0xeb, 0xea, 0x05, 0x39, 0x26,
0x19, 0x17, 0x54, 0x14, 0x4e, 0x43, 0x11, 0xda, 0x4c, 0xee, 0x1b, 0x68, 0x6b, 0xf3, 0xf8, 0xbb,
0x6b, 0x1d, 0x4f, 0x5d, 0xfb, 0x64, 0xea, 0xda, 0xa7, 0x53, 0xd7, 0xfe, 0x36, 0x75, 0xed, 0x4f,
0x67, 0xae, 0x75, 0x72, 0xe6, 0x5a, 0xa7, 0x67, 0xae, 0xf5, 0xa1, 0x69, 0x22, 0x1b, 0xce, 0xab,
0x5b, 0x7b, 0xfc, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x63, 0x5c, 0xa2, 0x72, 0xc1, 0x04, 0x00, 0x00,
// 693 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0x41, 0x4f, 0x13, 0x41,
0x14, 0xde, 0xa5, 0x85, 0xb6, 0xaf, 0x05, 0xcb, 0x88, 0xc9, 0x42, 0x64, 0x29, 0xab, 0x89, 0x04,
0x75, 0x9b, 0xe0, 0xc1, 0xc4, 0x18, 0x13, 0xaa, 0x05, 0x4c, 0x28, 0x92, 0x05, 0xa3, 0xf1, 0xb2,
0x99, 0xb6, 0xd3, 0x65, 0xc2, 0xee, 0xce, 0x66, 0x66, 0x1b, 0xd9, 0x7f, 0x61, 0xe2, 0x5f, 0xf2,
0xc0, 0x91, 0x23, 0x27, 0xa3, 0x25, 0xfe, 0x04, 0x6f, 0x1e, 0xcc, 0xce, 0xee, 0xd8, 0xa2, 0x28,
0x07, 0x6f, 0x6f, 0xde, 0xfb, 0xbe, 0xf7, 0xde, 0xf7, 0xde, 0x1b, 0xb8, 0x45, 0x38, 0x67, 0x5c,
0x44, 0xdd, 0x66, 0x66, 0xd8, 0x11, 0x67, 0x31, 0x43, 0xa8, 0xc7, 0x7a, 0xc7, 0x9c, 0x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, 0x4c, 0xed, 0xfc, 0xc2, 0xd4, 0xde, 0x95,
0xd5, 0x56, 0xbb, 0x33, 0xf2, 0x9e, 0x1f, 0xfd, 0x0c, 0x00, 0x00, 0xff, 0xff, 0xd7, 0x2c, 0x21,
0xe3, 0x75, 0x05, 0x00, 0x00,
}
func (m *EncodedError) Marshal() (dAtA []byte, err error) {
@@ -530,6 +579,20 @@ func (m *EncodedErrorLeaf) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if len(m.MultierrorCauses) > 0 {
for iNdEx := len(m.MultierrorCauses) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.MultierrorCauses[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintErrors(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x1a
}
}
{
size, err := m.Details.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
@@ -631,6 +694,11 @@ func (m *EncodedWrapper) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if m.MessageType != 0 {
i = encodeVarintErrors(dAtA, i, uint64(m.MessageType))
i--
dAtA[i] = 0x20
}
{
size, err := m.Details.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
@@ -641,10 +709,10 @@ func (m *EncodedWrapper) MarshalToSizedBuffer(dAtA []byte) (int, error) {
}
i--
dAtA[i] = 0x1a
if len(m.MessagePrefix) > 0 {
i -= len(m.MessagePrefix)
copy(dAtA[i:], m.MessagePrefix)
i = encodeVarintErrors(dAtA, i, uint64(len(m.MessagePrefix)))
if len(m.Message) > 0 {
i -= len(m.Message)
copy(dAtA[i:], m.Message)
i = encodeVarintErrors(dAtA, i, uint64(len(m.Message)))
i--
dAtA[i] = 0x12
}
@@ -874,6 +942,12 @@ func (m *EncodedErrorLeaf) Size() (n int) {
}
l = m.Details.Size()
n += 1 + l + sovErrors(uint64(l))
if len(m.MultierrorCauses) > 0 {
for _, e := range m.MultierrorCauses {
l = e.Size()
n += 1 + l + sovErrors(uint64(l))
}
}
return n
}
@@ -910,12 +984,15 @@ func (m *EncodedWrapper) Size() (n int) {
_ = l
l = m.Cause.Size()
n += 1 + l + sovErrors(uint64(l))
l = len(m.MessagePrefix)
l = len(m.Message)
if l > 0 {
n += 1 + l + sovErrors(uint64(l))
}
l = m.Details.Size()
n += 1 + l + sovErrors(uint64(l))
if m.MessageType != 0 {
n += 1 + sovErrors(uint64(m.MessageType))
}
return n
}
@@ -1202,6 +1279,40 @@ func (m *EncodedErrorLeaf) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field MultierrorCauses", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowErrors
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthErrors
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthErrors
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.MultierrorCauses = append(m.MultierrorCauses, &EncodedError{})
if err := m.MultierrorCauses[len(m.MultierrorCauses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipErrors(dAtA[iNdEx:])
@@ -1470,7 +1581,7 @@ func (m *EncodedWrapper) Unmarshal(dAtA []byte) error {
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field MessagePrefix", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -1498,7 +1609,7 @@ func (m *EncodedWrapper) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.MessagePrefix = string(dAtA[iNdEx:postIndex])
m.Message = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
@@ -1533,6 +1644,25 @@ func (m *EncodedWrapper) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
case 4:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field MessageType", wireType)
}
m.MessageType = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowErrors
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.MessageType |= MessageType(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipErrors(dAtA[iNdEx:])

View File

@@ -17,7 +17,7 @@ message EncodedError {
}
// EncodedErrorLeaf is the wire-encodable representation
// of an error leaf.
// of an error leaf or a multi-cause wrapper from go 1.20+
message EncodedErrorLeaf {
// The main error message (mandatory), that can be printed to human
// users and may contain PII. This contains the value of the leaf
@@ -26,6 +26,12 @@ message EncodedErrorLeaf {
// The error details.
EncodedErrorDetails details = 2 [(gogoproto.nullable) = false];
// multierror_causes is a list of errors that contain the causal tree
// of this leaf. If this field is not empty, then this leaf encodes
// an error from go 1.20 or later that encodes multiple causes in its
// chain.
repeated EncodedError multierror_causes = 3;
}
message EncodedErrorDetails {
@@ -60,24 +66,42 @@ message EncodedErrorDetails {
google.protobuf.Any full_details = 4;
}
// MessageType encodes information regarding the interpretation of an
// error's message string.
enum MessageType {
// Keeping zero value as default for backwards compatibility.
// PREFIX is a message that should be prepended to its cause.
PREFIX = 0;
// FULL_MESSAGE is a complete error message that can be displayed
// without its cause.
FULL_MESSAGE = 1;
}
// EncodedWrapper is the wire-encodable representation
// of an error wrapper.
message EncodedWrapper {
// The cause error. Mandatory.
EncodedError cause = 1 [(gogoproto.nullable) = false];
// The wrapper message prefix (which may be empty). This
// isbprinted before the cause's own message when
// constructing a full message. This may contain PII.
// The wrapper message. This could either be a full error message
// that can be printed independently, or a (potentially empty) prefix
// which is printed before the cause's own message to construct the
// full message. This may contain PII.
//
// This is extracted automatically:
//
// - for wrappers that have a registered encoder,
// - otherwise, when the wrapper's Error() has its cause's Error() as suffix.
string message_prefix = 2;
string message = 2;
// The error details.
EncodedErrorDetails details = 3 [(gogoproto.nullable) = false];
// message_type encodes the interpretation of `message`. Prior
// versions will not set this field and it will be left as `PREFIX`.
// This retains backwards compatibility since the new behavior is
// only enabled when this enum is set to `FULL_MESSAGE`.
MessageType message_type = 4;
}
// ErrorTypeMark identifies an error type for the purpose of determining