{"record":{"id":"efa2ab8ca3ba8991","repo":"iflytek/astron-agent","slug":"8008-exceed-authority","errorCode":"8008","errorMessage":"exceed.authority","messagePattern":"exceed\\.authority","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/controller/workflow/WorkflowAutomationController.java","lineNumber":53,"sourceCode":"@Validated\n@RequiredArgsConstructor\n@Tag(name = \"Workflow automation management interface\")\npublic class WorkflowAutomationController {\n\n    private final WorkflowAutomationService workflowAutomationService;\n\n    @GetMapping(\"/page\")\n    @SpacePreAuth(\n            key = \"WorkflowAutomationController_page_GET\",\n            module = \"Workflow Automation\",\n            point = \"Workflow Automation List\",\n            description = \"Workflow Automation List\")\n    public PageData<WorkflowAutomationTask> page(\n            @NotNull(message = \"Pagination parameters cannot be null\") Pagination pagination,\n            @RequestParam(required = false) String search,\n            @RequestParam(required = false) Boolean enabled) {\n        if (pagination.isEmpty()) {\n            throw new BusinessException(ResponseEnum.PAGE_SEPARATOR_MISS);\n        }\n        return workflowAutomationService.pageTasks(pagination.getCurrent(), pagination.getPageSize(), search, enabled);\n    }\n\n    @PostMapping\n    @SpacePreAuth(\n            key = \"WorkflowAutomationController_create_POST\",\n            module = \"Workflow Automation\",\n            point = \"Workflow Automation Create\",\n            description = \"Workflow Automation Create\")\n    public WorkflowAutomationTask create(@RequestBody @Valid WorkflowAutomationTaskReq req) {\n        return workflowAutomationService.createTask(req);\n    }\n\n    @PutMapping(\"/{id}\")\n    @SpacePreAuth(\n            key = \"WorkflowAutomationController_update_PUT\",\n            module = \"Workflow Automation\",","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/controller/workflow/WorkflowAutomationController.java#L35-L71","documentation":"BusinessException with ResponseEnum.PAGE_SEPARATOR_MISS, which is defined as (8008, \"exceed.authority\") — so the user-visible message 'exceed.authority' is misleading; the actual condition is missing/empty pagination parameters. WorkflowAutomationController.page rejects the request when pagination.isEmpty() is true before querying tasks.","triggerScenarios":"GET the workflow-automation list endpoint without current/pageSize (or with a Pagination object that isEmpty() reports as empty), e.g. /workflow-automation?search=foo with no paging params.","commonSituations":"Client omits default paging values; frontend pagination component not initialized on first render; proxies/gateways stripping query params; Pagination considered empty when both current and size are null.","solutions":["Always send current and pageSize query parameters, e.g. ?current=1&pageSize=10.","Set client defaults (current=1, pageSize=10/20) before issuing the request.","Server-side: default the pagination when empty instead of throwing, or use a dedicated 'missing pagination parameters' response code so the message isn't 'exceed.authority'.","Check the request URL in the browser network tab to confirm the paging params are actually sent."],"exampleFix":"// before\nGET /workflow-automation?search=backup\n// after\nGET /workflow-automation?search=backup&current=1&pageSize=10","handlingStrategy":"validation","validationCode":"function buildListQuery({ current = 1, pageSize = 10, ...rest }) {\n  const params = new URLSearchParams({ current: String(current), pageSize: String(pageSize) });\n  Object.entries(rest).forEach(([k, v]) => v != null && params.append(k, String(v)));\n  return params.toString();\n}","typeGuard":"const hasPagination = (p) => p != null && p.current != null && p.pageSize != null;","tryCatchPattern":"try {\n  const page = await api.listAutomationTasks(query);\n} catch (e) {\n  if (e.code === 8008 && (!query.current || !query.pageSize)) {\n    // message says 'exceed.authority' but the real cause is missing paging params\n    return api.listAutomationTasks({ ...query, current: 1, pageSize: 10 });\n  } else throw e;\n}","preventionTips":["Never call list endpoints without current and pageSize.","Set defaults in the API client wrapper, not at each call site.","Treat code 8008 on list endpoints as a pagination problem, not a permissions problem."],"tags":["pagination","validation","workflow"],"backgroundTag":"missing-required-argument","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}