optimize class DictMgr by adding a custom exception handler