mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-30 02:43:01 +00:00
079d0bd8a9
* Refactor log * Add new log methods * Fix logger test * Change all logging code * Clean up pathObj * Rebase to latest main * Remove invoking method name after the dot
27 lines
571 B
Go
27 lines
571 B
Go
package observatory
|
|
|
|
import "github.com/xtls/xray-core/common/errors"
|
|
|
|
type errorCollector struct {
|
|
errors *errors.Error
|
|
}
|
|
|
|
func (e *errorCollector) SubmitError(err error) {
|
|
if e.errors == nil {
|
|
e.errors = errors.New("underlying connection error").Base(err)
|
|
return
|
|
}
|
|
e.errors = e.errors.Base(errors.New("underlying connection error").Base(err))
|
|
}
|
|
|
|
func newErrorCollector() *errorCollector {
|
|
return &errorCollector{}
|
|
}
|
|
|
|
func (e *errorCollector) UnderlyingError() error {
|
|
if e.errors == nil {
|
|
return errors.New("failed to produce report")
|
|
}
|
|
return e.errors
|
|
}
|