title: Cannot convert return expression of type 'Publishers.FlatMap<AnyPublisher<>, AnyPublisher<>>' to return type 'AnyPublisher<>'
body: <p>I am having difficulties fully understanding Combine. Here I have an issue where I can't seem to return the correct Output type.</p>
  <p>How can I do this?</p>
  <pre><code>func test(ticketId: String) -&gt; AnyPublisher&lt;Void, Error&gt; {
  
      campaignByTicketIdUseCase.execute(ticketId: ticketId)     // this is AnyPublisher&lt;Campaign,Error&gt;
      .flatMap { (campaign) -&gt; AnyPublisher&lt;Void, Error&gt; in     // this is where the error is thrown
  
          guard let url = URL(string: &quot;url&quot;),
          validator.isParticipationValid(campaignIdentifier: campaign.identifier) else {
              return Result&lt;Void, Error&gt;.failure(HttpError()).publisher.eraseToAnyPublisher()
          }
  
          var request = URLRequest(url: url)
          request.httpMethod = &quot;POST&quot;
  
          return AuthSession.shared.doRequest(request: request)
          .tryMap({ (_: Data, response: URLResponse) -&gt; Void in
              if let httpResponse = response as? HTTPURLResponse, httpResponse.statusCode != 200 {
                  throw HttpError()
              }
          }).eraseToAnyPublisher()
      }
  }
  </code></pre>