From 28871d73ace30f5f21455cd77e38cc743968fd30 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 11 Jun 2018 08:51:56 -0700 Subject: GitHub Rake importer: Fail with a clearer explanation if GitLab username is wrong --- lib/tasks/import.rake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/tasks/import.rake') diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake index aafbe52e5f8..1f185dae6fc 100644 --- a/lib/tasks/import.rake +++ b/lib/tasks/import.rake @@ -9,7 +9,10 @@ class GithubImport def initialize(token, gitlab_username, project_path, extras) @options = { token: token } @project_path = project_path - @current_user = User.find_by_username(gitlab_username) + @current_user = User.find_by(username: gitlab_username) + + raise "GitLab user #{gitlab_username} not found. Please specify a valid username." unless @current_user + @github_repo = extras.empty? ? nil : extras.first end -- cgit v1.2.3