       "framework_search_paths": self.parseFrameworkSearchPaths,
       "target_type":            self.parseTargetType,
       "dependencies":           self.parseDependencies,
+      "precompile_commands":    self.parsePrecompileCommands,
+    ]
+    let failableActionMap = [
       "test_target":            self.parseTestTarget,
       "compiler_options":       self.parseCompilerOptions,
-      "precompile_commands":    self.parsePrecompileCommands,
     ]
 
     if let dictionary = yaml.value!.dictionary {
       for (keyYaml, valueYaml) in dictionary {
         if let key = keyYaml.string {
-          if let action = map[key] {
+          if let action = failableActionMap[key] {
+            let error = action(valueYaml)
+            if error != nil { return error }
+
+          } else if let action = unfailableActionMap[key] {
             action(valueYaml)
-            continue
+
           } else {
-            printAndExit("Can't parse key '\(key)'")
+            return ParsingError(message: "Can't parse key '\(key)'")
           }
-
+          continue
         } else {
-          printAndExit("Can't parse key")
+          return ParsingError(message: "Can't parse key")
         }
       }// for
 
     } else {
-      printAndExit("Can't parse document; expected dictionary")
-    }
-
+      return ParsingError(message: "Can't parse document; expected dictionary")
+    }
+
+    return nil
   }// parseFromString
 
   func asPackage() -> Package {

  var testTarget: TestTarget?
  var testCompilerOptions: String = ""

  func parseFromString(string: String) {
    let yaml = Yaml.load(string)

    if let error = yaml.error {
      printAndExit(error)
    }

    // Map names to processors
    let map = [
      "name":                   self.parseName,
      "version":                self.parseVersion,
      "sources":                self.parseSources,

        return s.string!
      }
    } else {
      return ParsingError(message: "Missing `sources` array in test target")
    }

    if let options = yaml["compiler_options"].string {
