Using `mapError` on Option in Effect: Correct Approach?

Is this correct? It feels wrong to use mapError on an option... but I remembered what I always get as an answer when I am confused about Eithers an Options in effect... they are just a subtype of Effect....
      const user = yield* pipe(
        results,
        A.head,
        Effect.mapError(() => UnexpectedError.create("User not found"))
      );

So I guess that is.... the right way?
Was this page helpful?