This is an automated email from the ASF dual-hosted git repository.

abeizn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit e616c24f8383b4f14d841fce3e5d2d82c96754d5
Author: PRANSHU RAJ <[email protected]>
AuthorDate: Thu Jul 21 11:05:46 2022 +0530

    perf: added the error handling
    
    Added the error handling in GetConnection
---
 plugins/gitlab/api/connection.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/plugins/gitlab/api/connection.go b/plugins/gitlab/api/connection.go
index e60417fa..22b1a539 100644
--- a/plugins/gitlab/api/connection.go
+++ b/plugins/gitlab/api/connection.go
@@ -159,6 +159,9 @@ func ListConnections(input *core.ApiResourceInput) 
(*core.ApiResourceOutput, err
 func GetConnection(input *core.ApiResourceInput) (*core.ApiResourceOutput, 
error) {
        connection := &models.GitlabConnection{}
        err := connectionHelper.First(connection, input.Params)
+       if err != nil {
+               return nil, err
+       }
        return &core.ApiResourceOutput{Body: connection}, err
 }
 

Reply via email to