Exiting Generator with Failure

In a generator, is this the right way to exit with a failure that properly propagates? Or is there any shorthand?
if(!user) return yield* Effect.fail(new InvalidParams({ cause: "missing user" }));
Was this page helpful?