add 'config.json' support and turn into using util.error.