I wrote this line of code :
{{1, 1, 1}, {1, 1}} /. ((x___ /; Length[x] > 2) -> Partition[x, 2, 1])
generates this error :
Partition::pdep: Depth 1 requested in object with dimensions {}.
The questions are simple :
Is it possible to avoid this error ?
Are there any alternative ?
Thank you for your attention.
Edit
Thank you for your answers.
I did not realize the utility of RuleDelayed up to now .