Which exception is thrown here? If the exception is expected, maybe we should document in the rewriter