made the error check more generic and focused on a 500 and presence of (e)'rror'