diff options
| author | 2023-09-07 13:20:37 +0200 | |
|---|---|---|
| committer | 2023-09-07 13:20:37 +0200 | |
| commit | 14ef09809942800db57de87fe3963770a56b585b (patch) | |
| tree | 89e95f21145bc7ad5745f77be1d998faa9c09695 /vendor/google.golang.org/grpc/status/status.go | |
| parent | [bugfix] fix checks for deref the same status descendants / ascendants (#2181) (diff) | |
| download | gotosocial-14ef09809942800db57de87fe3963770a56b585b.tar.xz | |
[feature] Support OTLP HTTP, drop Jaeger (#2184)
* [feature] Add http trace exporter, drop Jaeger
Jaeger supports ingesting traces using the OpenTelemetry gRPC or HTTP
methods. The Jaeger project has deprecated the old jaeger transport.
* Add support for submitting traces over HTTP
* Drop support for the old Jaeger protocol
* Upgrade the trace libraries to v1.17
Fixes: #2176
Fixes: #2179
Diffstat (limited to 'vendor/google.golang.org/grpc/status/status.go')
| -rw-r--r-- | vendor/google.golang.org/grpc/status/status.go | 29 | 
1 files changed, 25 insertions, 4 deletions
| diff --git a/vendor/google.golang.org/grpc/status/status.go b/vendor/google.golang.org/grpc/status/status.go index 53910fb7c..bcf2e4d81 100644 --- a/vendor/google.golang.org/grpc/status/status.go +++ b/vendor/google.golang.org/grpc/status/status.go @@ -77,11 +77,18 @@ func FromProto(s *spb.Status) *Status {  // FromError returns a Status representation of err.  //  //   - If err was produced by this package or implements the method `GRPCStatus() -//     *Status`, or if err wraps a type satisfying this, the appropriate Status is -//     returned.  For wrapped errors, the message returned contains the entire -//     err.Error() text and not just the wrapped status. +//     *Status` and `GRPCStatus()` does not return nil, or if err wraps a type +//     satisfying this, the Status from `GRPCStatus()` is returned.  For wrapped +//     errors, the message returned contains the entire err.Error() text and not +//     just the wrapped status. In that case, ok is true.  // -//   - If err is nil, a Status is returned with codes.OK and no message. +//   - If err is nil, a Status is returned with codes.OK and no message, and ok +//     is true. +// +//   - If err implements the method `GRPCStatus() *Status` and `GRPCStatus()` +//     returns nil (which maps to Codes.OK), or if err wraps a type +//     satisfying this, a Status is returned with codes.Unknown and err's +//     Error() message, and ok is false.  //  //   - Otherwise, err is an error not compatible with this package.  In this  //     case, a Status is returned with codes.Unknown and err's Error() message, @@ -92,10 +99,24 @@ func FromError(err error) (s *Status, ok bool) {  	}  	type grpcstatus interface{ GRPCStatus() *Status }  	if gs, ok := err.(grpcstatus); ok { +		if gs.GRPCStatus() == nil { +			// Error has status nil, which maps to codes.OK. There +			// is no sensible behavior for this, so we turn it into +			// an error with codes.Unknown and discard the existing +			// status. +			return New(codes.Unknown, err.Error()), false +		}  		return gs.GRPCStatus(), true  	}  	var gs grpcstatus  	if errors.As(err, &gs) { +		if gs.GRPCStatus() == nil { +			// Error wraps an error that has status nil, which maps +			// to codes.OK.  There is no sensible behavior for this, +			// so we turn it into an error with codes.Unknown and +			// discard the existing status. +			return New(codes.Unknown, err.Error()), false +		}  		p := gs.GRPCStatus().Proto()  		p.Message = err.Error()  		return status.FromProto(p), true | 
