flexible error to hash