there is another one by Rumi:

Once a prophet was going to wear his shoe when an eagle came along and took it away. the prophet saw that a snake fell out of the shoe before the eagle dropped it off.

___

MISFORTUNE

Look carefully around you and recognize
the luminosity of souls. Sit beside those
who draw you to that.

When misfortune comes, you must quickly praise.

Others may be saying, Oh no, but you
will be opening out like a rose
losing itself petal by petal.

Someone once asked a great sheikh
what sufism was.
"The feeling of joy
when sudden disappointment comes.'

Don't grieve for what doesn't come
Some things that don't happen
keep disasters from happening.

--Rumi (translated by Coleman Barks)