Raise a correct error when content isn't padded correctly