Convert is a convenience function which removes the need to handle the boolean return value from FromError.
(err error)
| 129 | // Convert is a convenience function which removes the need to handle the |
| 130 | // boolean return value from FromError. |
| 131 | func Convert(err error) *Status { |
| 132 | s, _ := FromError(err) |
| 133 | return s |
| 134 | } |
| 135 | |
| 136 | // Code returns the Code of the error if it is a Status error or if it wraps a |
| 137 | // Status error. If that is not the case, it returns codes.OK if err is nil, or |