     }
 }
 
+enum SchemeGenerationError: Error, CustomStringConvertible {
+
+    case missingTarget(Scheme.BuildTarget, projectPath: String)
+    case missingProject(String)
+
+    var description: String {
+        switch self {
+        case .missingTarget(let buildTarget, let projectPath):
+            return "Unable to find target named \"\(buildTarget.target)\" in \"\(projectPath)\""
+        case .missingProject(let project):
+            return "Unable to find project reference named \"\(project)\" in project.yml"
+        }
+    }
+}
+
 extension Scheme {
     public init(name: String, target: Target, targetScheme: TargetScheme, debugConfig: String, releaseConfig: String) {
         self.init(

            switch buildTarget.target.location {
            case .project(let project):
                guard let projectReference = self.project.getProjectReference(project) else {
                    fatalError("Unable to find project reference named \"\(project)\" in project.yml")
                }
                pbxProj = try XcodeProj(pathString: projectReference.path).pbxproj
                projectFilePath = projectReference.path

            }

            guard let pbxTarget = pbxProj.targets(named: buildTarget.target.name).first else {
                throw SchemeGenerationError.missingTarget(buildTarget, projectPath: projectFilePath)
            }

            let buildableName: String
