How to diagnose «URL key for specified store already exists»?

The «URL key for specified store already exists» message is throws in the following 2-3 places:

1. \Magento\UrlRewrite\Model\Storage\AbstractStorage::replace()

2. \Magento\UrlRewrite\Model\Storage\DbStorage::insertMultiple()

3. \Magento\UrlRewrite\Model\Storage\DbStorage::doReplace()

It is only for the recent Magento 2.2 versions >= 2.2.0-RC1.4.

How to diagnose it

The built-in exception handling of the all these 3 cases is low-quality: it just missed the original exception message and its backtrace.
So to diagnose the exception, log the original exception manually, or set a debugger breakpoint in these 3 code places.