Modified the way to catch exception when sync tables.