You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/05/29 06:38:48 UTC

[GitHub] [pulsar-client-go] keithnull commented on issue #264: [Improve] Unified processing of error information in the project

keithnull commented on issue #264:
URL: https://github.com/apache/pulsar-client-go/issues/264#issuecomment-635790148


   @wolfstudy 
   
   I've checked all error-related logs, which can be classified as:
   
   1. `.WithError(someErr).Error("some string")`
   1. `.WithError(someErr).Error()`
   1. `.Error("some string")`
   
   Type 1 and 2 are exactly what we desire. For Type 3, if we want to make them unified, we need to define some `error` consts and use them instead, like:
   
   ```go
   someErr := fmt.Errorf("some string")
   // log.Error("some string")
   log.WithError(someErr).Error()
   ```
   
   But currently, existing errors are not very universal, i.e., they usually contain information specific to only a few situations. Therefore, maybe it's not quite necessary to do this now.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org