Skip to content
Snippets Groups Projects
Commit 41a9e4c6 authored by Damyan Mitev's avatar Damyan Mitev :beach:
Browse files

add error logging to server unary interceptor

parent 013a3d9f
No related branches found
No related tags found
1 merge request!57Refactor EMA error handling
...@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import ( import (
"code.vereign.com/code/viam-apis/errors"
"crypto/tls" "crypto/tls"
"crypto/x509" "crypto/x509"
"fmt" "fmt"
...@@ -103,7 +104,11 @@ func unaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServ ...@@ -103,7 +104,11 @@ func unaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServ
ctx = context.WithValue(ctx, clientIDKey, clientID) ctx = context.WithValue(ctx, clientIDKey, clientID)
return handler1(ctx, req) res, err := handler1(ctx, req)
if err != nil {
errors.Log(err)
}
return res, err
} }
func StartGRPCServer(address string, certPEM, privateKeyPEM, caCertPEM, vereignCertPEM, vereignPrivateKeyPEM []byte, dataStorageAddress string, maxMessageSize int) error { func StartGRPCServer(address string, certPEM, privateKeyPEM, caCertPEM, vereignCertPEM, vereignPrivateKeyPEM []byte, dataStorageAddress string, maxMessageSize int) error {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment