Issue #20266 Add try catch for error handling.
Issue #20254 Fix Discovery Doc generation current_database() needs to be text.