Group Group Group Group Group Group Group Group Group

Chapter 12. Creating a Simple iPhone App

I am following the book on Vapor here by doing the whole book project from the start myself and now I get the following error in my getAll(completion:) function in ResourceRequest.swift that is supposed to be used for values fetching: “Cannot find type “ResourceRequestError” in scope”. The function looks like this:

`// get all values, takes completion closure as parameter
func getAll(completion: @escaping (Result<[ResourceType], ResourceRequestError>) -> Void) {
// create data task with resource url
let dataTask = URLSession.shared.dataTask(with: resourceURL) { data, _, _ in
// ensure response returns some data, otherwise call completion with failure case
guard let jsonData = data else {

        do {
            // decode response data
            let resources = try JSONDecoder()
                    from: jsonData)
            // call completion with .success case
        } catch {
            // catch errors
    // start data task

I went through the starter project files and cannot seem to find where the type is defined there either.

There error is defined here vpr-materials/ResourceRequestError.swift at editions/3.0 · raywenderlich/vpr-materials · GitHub

Thank you! This helped.