# HG changeset patch # User Jakob Skjerning # Date 1249238683 -7200 # Node ID 62f1488f85c300318a2a32c2e20fc24b8eaf2bbe # Parent 7ac216b978a2e3db7d55ffd4901ea599459767b7 Fix typo, improve error handling diff -r 7ac216b978a2e3db7d55ffd4901ea599459767b7 -r 62f1488f85c300318a2a32c2e20fc24b8eaf2bbe app/controllers/github_hook_controller.rb --- a/app/controllers/github_hook_controller.rb Sun Aug 02 20:42:10 2009 +0200 +++ b/app/controllers/github_hook_controller.rb Sun Aug 02 20:44:43 2009 +0200 @@ -9,7 +9,8 @@ identifier = payload['repository']['name'] # For now, we assume that the repository name is the same as the project identifier project = Project.find_by_identifier(identifier) - raise ActiveRecord::RecordNotFound, "No project find with identifier '#{identifier}'" if project.nil? || project.repository.nil? + raise ActiveRecord::RecordNotFound, "No project found with identifier '#{identifier}'" if project.nil? + raise TypeError, "Project '#{identifier}' has no repository" if project.repository.nil? repository = project.repository raise TypeError, "Repository for project '#{identifier}' is not a Git repository" unless repository.is_a?(Repository::Git)