storj/pkg/process/error.go

19 lines
375 B
Go
Raw Normal View History

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
package process
import (
"google.golang.org/grpc/status"
monkit "gopkg.in/spacemonkeygo/monkit.v2"
)
func init() {
monkit.AddErrorNameHandler(func(err error) (string, bool) {
if s, ok := status.FromError(err); ok {
return "grpc_" + s.Code().String(), true
}
return "", false
})
}