You can always match on reason
. It will likely be :normal
if it exits normally (this is the second message you’re seeing after the value) and then likely :shutdown
or {:shutdown, value}
if it’s canceled. Anything else is, I believe, considered “failure” in OTP-land.