@@ -3,7 +3,7 @@ var api = require('./api');
33var async = require ( 'async' ) ;
44var util = require ( 'util' ) ;
55var webhooks = require ( './webhooks' ) ;
6-
6+ var debug = require ( 'debug' ) ( 'strider-gitlab:webapp' ) ;
77var hostname = process . env . strider_server_name || 'http://localhost:3000' ;
88
99module . exports = {
@@ -30,7 +30,9 @@ module.exports = {
3030 api . get ( config , 'projects' , function ( err , repos ) {
3131 if ( err ) return done ( err ) ;
3232
33- repos = JSON . parse ( repos ) ;
33+ if ( ! repos ) {
34+ return done ( new Error ( "Could not get a list of projects from the GitLab repository. Please check the configuration in Account->GitLab." ) ) ;
35+ }
3436
3537 // Parse and filter only git repos
3638 done ( null , repos . map ( api . parseRepo ) . filter ( function ( repo ) {
@@ -55,9 +57,9 @@ module.exports = {
5557
5658 var uri = util . format ( 'projects/%d/repository/branches' , repo_id ) ;
5759
60+ debug ( "Getting URI " + uri ) ;
5861 api . get ( account , uri , function ( err , branches ) {
59-
60- branches = JSON . parse ( branches ) ;
62+ debug ( "We get the following as branches: " + JSON . stringify ( branches ) ) ;
6163
6264 done ( err , _ . map ( branches || [ ] , function ( branch ) {
6365 return branch . name
0 commit comments