From 75b72d5c7b54275d67bdfeaa92b4bea84923a9f1 Mon Sep 17 00:00:00 2001 From: aultokped Date: Mon, 5 Nov 2018 13:48:26 +0700 Subject: [PATCH] remove os exit from handling --- core/resource.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/resource.go b/core/resource.go index 5be8009..1046959 100644 --- a/core/resource.go +++ b/core/resource.go @@ -146,8 +146,7 @@ func (r *Resource) Invoke(ctx context.Context, symbol string, in io.Reader) (str } if h.Status.Code() != codes.OK { - log.Printf("ERROR:\n Code: %s\n Message: %s\n", h.Status.Code().String(), h.Status.Message()) - r.exit(1) + return "", end, fmt.Errorf(h.Status.Message()) } // copy the output in a separate goroutine so printing can't block indefinitely