{"record":{"id":"6d9efc943a9df03b","repo":"iflytek/astron-agent","slug":"operation-failed-result-message","errorCode":"OPERATION_FAILED","errorMessage":"result.message()","messagePattern":"result\\.message\\(\\)","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/publish/impl/PublishApprovalServiceImpl.java","lineNumber":174,"sourceCode":"            throw new BusinessException(ResponseEnum.INSUFFICIENT_PERMISSIONS);\n        }\n        return toDto(approval, canReview, currentUid);\n    }\n\n    @Override\n    public PublishApprovalDecisionDto approve(\n            Long approvalId,\n            PublishApprovalReviewDto reviewDto,\n            String reviewerUid,\n            Long spaceId) {\n        assertReviewer(spaceId, reviewerUid);\n        PublishApproval approval = requirePendingApproval(approvalId, spaceId);\n        markExecuting(approval, reviewDto, reviewerUid);\n\n        try {\n            ApiResult<Object> result = executeWithoutRequestContext(approval);\n            if (result != null && result.code() != 0) {\n                throw new BusinessException(ResponseEnum.OPERATION_FAILED, result.message());\n            }\n            approval.setApprovalStatus(PublishApprovalStatusEnum.APPROVED.name());\n            approval.setExecutionResult(JSON.toJSONString(result == null ? null : result.data()));\n            approval.setExecutedTime(LocalDateTime.now());\n            approval.setUpdatedTime(LocalDateTime.now());\n            publishApprovalMapper.updateById(approval);\n            return decision(false, approval.getId(), PublishApprovalStatusEnum.APPROVED.name());\n        } catch (RuntimeException e) {\n            approval.setApprovalStatus(PublishApprovalStatusEnum.EXECUTE_FAILED.name());\n            approval.setExecutionResult(JSON.toJSONString(e.getMessage()));\n            approval.setExecutedTime(LocalDateTime.now());\n            approval.setUpdatedTime(LocalDateTime.now());\n            publishApprovalMapper.updateById(approval);\n            throw e;\n        }\n    }\n\n    @Override","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/publish/impl/PublishApprovalServiceImpl.java#L156-L192","documentation":"OPERATION_FAILED (with the upstream result.message() as detail) is thrown in approve when the operation executed on behalf of the approval returns an ApiResult with a non-zero code. The approval is valid; the downstream action it triggered failed.","triggerScenarios":"executeWithoutRequestContext(approval) returns an ApiResult with code != 0 (downstream publish/offline call rejected).","commonSituations":"Downstream publish service unavailable; target resource state changed since submission; transient upstream error.","solutions":["Read result.message() in logs/exception for the upstream failure reason.","Fix the target resource state and re-approve.","Check health/connectivity of the downstream publish service.","Cancel and re-submit the approval if the target is unrecoverable."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    publishApprovalService.approve(approvalId, reviewDto, reviewerUid);\n} catch (BusinessException e) {\n    if (\"OPERATION_FAILED\".equals(String.valueOf(e.getCode()))) {\n        // inspect e.getMessage() (upstream result.message()) and retry after fixing target\n    }\n}","preventionTips":["Pre-check the target resource state before approving.","Monitor downstream publish service health.","Log result.message() for diagnosis."],"tags":["upstream","api-error","approval-execution"],"backgroundTag":"upstream-api-error","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"}