mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-11-02 20:02:25 -06:00 
			
		
		
		
	[chore] update latest deps, ensure readme up to date (#1873)
* [chore] update latest deps, ensure readme up to date * remove double entry
This commit is contained in:
		
					parent
					
						
							
								f1b70cc00f
							
						
					
				
			
			
				commit
				
					
						b401bd1ccb
					
				
			
		
					 156 changed files with 11730 additions and 2842 deletions
				
			
		
							
								
								
									
										30
									
								
								vendor/google.golang.org/grpc/status/status.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										30
									
								
								vendor/google.golang.org/grpc/status/status.go
									
										
									
										generated
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -77,7 +77,9 @@ 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`, the appropriate Status is returned.
 | 
			
		||||
//     *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.
 | 
			
		||||
//
 | 
			
		||||
//   - If err is nil, a Status is returned with codes.OK and no message.
 | 
			
		||||
//
 | 
			
		||||
| 
						 | 
				
			
			@ -88,10 +90,15 @@ func FromError(err error) (s *Status, ok bool) {
 | 
			
		|||
	if err == nil {
 | 
			
		||||
		return nil, true
 | 
			
		||||
	}
 | 
			
		||||
	if se, ok := err.(interface {
 | 
			
		||||
		GRPCStatus() *Status
 | 
			
		||||
	}); ok {
 | 
			
		||||
		return se.GRPCStatus(), true
 | 
			
		||||
	type grpcstatus interface{ GRPCStatus() *Status }
 | 
			
		||||
	if gs, ok := err.(grpcstatus); ok {
 | 
			
		||||
		return gs.GRPCStatus(), true
 | 
			
		||||
	}
 | 
			
		||||
	var gs grpcstatus
 | 
			
		||||
	if errors.As(err, &gs) {
 | 
			
		||||
		p := gs.GRPCStatus().Proto()
 | 
			
		||||
		p.Message = err.Error()
 | 
			
		||||
		return status.FromProto(p), true
 | 
			
		||||
	}
 | 
			
		||||
	return New(codes.Unknown, err.Error()), false
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -103,19 +110,16 @@ func Convert(err error) *Status {
 | 
			
		|||
	return s
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Code returns the Code of the error if it is a Status error, codes.OK if err
 | 
			
		||||
// is nil, or codes.Unknown otherwise.
 | 
			
		||||
// Code returns the Code of the error if it is a Status error or if it wraps a
 | 
			
		||||
// Status error. If that is not the case, it returns codes.OK if err is nil, or
 | 
			
		||||
// codes.Unknown otherwise.
 | 
			
		||||
func Code(err error) codes.Code {
 | 
			
		||||
	// Don't use FromError to avoid allocation of OK status.
 | 
			
		||||
	if err == nil {
 | 
			
		||||
		return codes.OK
 | 
			
		||||
	}
 | 
			
		||||
	if se, ok := err.(interface {
 | 
			
		||||
		GRPCStatus() *Status
 | 
			
		||||
	}); ok {
 | 
			
		||||
		return se.GRPCStatus().Code()
 | 
			
		||||
	}
 | 
			
		||||
	return codes.Unknown
 | 
			
		||||
 | 
			
		||||
	return Convert(err).Code()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// FromContextError converts a context error or wrapped context error into a
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue