errors are serialized consistently for promises and sync returns