That's literally what returning optional does.
Effect systems usually fail because effects are very different from each other and can't be generalised.