More flexible error messaging