mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-27 01:13:01 +00:00
5c366db847
Co-authored-by: Shelikhoo <xiaokangwang@outlook.com>
27 lines
565 B
Go
27 lines
565 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 = newError("underlying connection error").Base(err)
|
|
return
|
|
}
|
|
e.errors = e.errors.Base(newError("underlying connection error").Base(err))
|
|
}
|
|
|
|
func newErrorCollector() *errorCollector {
|
|
return &errorCollector{}
|
|
}
|
|
|
|
func (e *errorCollector) UnderlyingError() error {
|
|
if e.errors == nil {
|
|
return newError("failed to produce report")
|
|
}
|
|
return e.errors
|
|
}
|