catch exceptions on layer creation