Catch exception thrown by setting an unknown key

* log exception in debug mode