From 937f5bdca88e715040c99990f6c8e89b5614cd29 Mon Sep 17 00:00:00 2001 From: Nate Mara Date: Fri, 29 Jun 2018 10:01:28 -0400 Subject: [PATCH] Handle error with NewJiraError --- component.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/component.go b/component.go index f1e7c157..407ad36a 100644 --- a/component.go +++ b/component.go @@ -30,5 +30,9 @@ func (s *ComponentService) Create(options *CreateComponentOptions) (*ProjectComp component := new(ProjectComponent) resp, err := s.client.Do(req, component) - return component, resp, err + if err != nil { + return nil, resp, NewJiraError(resp, err) + } + + return component, resp, nil }