Catch ValueError exception during migration