소스 검색

Use error type instead of error message to check v1 connection error

Alasdair Smith 8 년 전
부모
커밋
8de9e9fae4
1개의 변경된 파일과 1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      services/web/app/coffee/Features/Project/ProjectController.coffee

+ 1 - 1
services/web/app/coffee/Features/Project/ProjectController.coffee

@@ -180,7 +180,7 @@ module.exports = ProjectController =
 				ProjectGetter.findAllUsersProjects user_id, 'name lastUpdated publicAccesLevel archived owner_ref tokens', cb
 			v1Projects: (cb) ->
 				Modules.hooks.fire "findAllV1Projects", user_id, (error, projects = []) ->
-					if error? and error.message == 'No V1 connection'
+					if error? and error instanceof V1ConnectionError
 						return cb(null, projects: [], tags: [], noConnection: true)
 					return cb(error, projects[0]) # hooks.fire returns an array of results, only need first
 			hasSubscription: (cb)->