iflytek/astron-agent · error · BusinessException
REPO_FILE_NAME_CANNOT_EMPTY
REPO_FILE_NAME_CANNOT_EMPTY
Error message
REPO_FILE_NAME_CANNOT_EMPTY
What it means
createFolder validates the requested folder name first: ObjectIsNull.check(name) detects an empty/blank name and throws BusinessException(REPO_FILE_NAME_CANNOT_EMPTY). A folder must have a non-empty name before character-legality and parent/repo resolution can proceed.
Solutions
- Populate CreateFolderVO.name with the intended folder name before calling the API.
- Add required-field validation on the client form so submission is blocked when name is blank.
- Trim input server-side before ObjectIsNull.check if whitespace-only names should be treated as valid content.
Example fix
// before
CreateFolderVO vo = new CreateFolderVO();
vo.setName("");
fileInfoV2Service.createFolder(vo);
// after
CreateFolderVO vo = new CreateFolderVO();
vo.setName("reports");
fileInfoV2Service.createFolder(vo); Defensive patterns
Strategy: validation
Validate before calling
if (name == null || name.trim().isEmpty()) {
// block submission / show 'name is required' in UI
return;
} Try / catch
try {
fileInfoV2Service.createFolder(vo);
} catch (BusinessException e) {
if ("REPO_FILE_NAME_CANNOT_EMPTY".equals(e.getCode())) {
// mark name field as required error
}
} Prevention
- Make the folder-name input required in the create dialog.
- Trim whitespace before submit so blank-but-spaced values are caught early.
- Never construct CreateFolderVO without explicitly setting a name.
When it happens
Trigger: Calling createFolder with a CreateFolderVO whose name is null, empty string, or whitespace-only — e.g. user clicked 'create folder' without typing a name, or the client sent an unset name field.
Common situations: Frontend form submitted with empty input because required-field validation is missing; API consumers omitting "name" in the JSON body; automated scripts building VOs with default empty strings.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/97e5878a31a5503a.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/repo/FileInfoV2Service.java:1887
}
pageData.setTotalCount(modelListCount);
pageData.setPageData(fileDirectoryTreeDtoList);
return pageData;
}
/**
* Create a new folder in the repository
*
* @param folderVO folder creation parameters containing name, repository ID, and parent ID
* @throws BusinessException if folder name is empty, contains illegal characters, or repository
* access is denied
*/
public void createFolder(CreateFolderVO folderVO) {
String name = folderVO.getName();
Pattern pattern = Pattern.compile("[\\\\/:*?\"<>|]");
if (ObjectIsNull.check(name)) {
throw new BusinessException(ResponseEnum.REPO_FILE_NAME_CANNOT_EMPTY);
} else {
boolean flag = pattern.matcher(name).find();
if (flag) {
throw new BusinessException(ResponseEnum.REPO_FOLDER_NAME_ILLEGAL);
}
}
Long parentId = folderVO.getParentId();
Repo repo = repoService.getById(folderVO.getRepoId());
if (repo != null) {
dataPermissionCheckTool.checkRepoBelong(repo);
}
FileDirectoryTree fileDirectoryTree;
// Non-empty means a folder with the same name exists in the same directory, user creation is not
// allowed
/*
* if (!ObjectIsNull.check(fileDirectoryTree)) { throw newView on GitHub (pinned to 5e758547a8)