cast reason to Error in callback [ci skip]