Replace deprecated error.message by str(error)