iflytek/astron-agent · error · BusinessException

OPERATION_FAILED

OPERATION_FAILED

Error message

result.message()

What it means

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.

Solutions

  1. Read result.message() in logs/exception for the upstream failure reason.
  2. Fix the target resource state and re-approve.
  3. Check health/connectivity of the downstream publish service.
  4. Cancel and re-submit the approval if the target is unrecoverable.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    publishApprovalService.approve(approvalId, reviewDto, reviewerUid);
} catch (BusinessException e) {
    if ("OPERATION_FAILED".equals(String.valueOf(e.getCode()))) {
        // inspect e.getMessage() (upstream result.message()) and retry after fixing target
    }
}

Prevention

When it happens

Trigger: executeWithoutRequestContext(approval) returns an ApiResult with code != 0 (downstream publish/offline call rejected).

Common situations: Downstream publish service unavailable; target resource state changed since submission; transient upstream error.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/6d9efc943a9df03b. Report an issue: GitHub.

Appendix: source

Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/publish/impl/PublishApprovalServiceImpl.java:174

            throw new BusinessException(ResponseEnum.INSUFFICIENT_PERMISSIONS);
        }
        return toDto(approval, canReview, currentUid);
    }

    @Override
    public PublishApprovalDecisionDto approve(
            Long approvalId,
            PublishApprovalReviewDto reviewDto,
            String reviewerUid,
            Long spaceId) {
        assertReviewer(spaceId, reviewerUid);
        PublishApproval approval = requirePendingApproval(approvalId, spaceId);
        markExecuting(approval, reviewDto, reviewerUid);

        try {
            ApiResult<Object> result = executeWithoutRequestContext(approval);
            if (result != null && result.code() != 0) {
                throw new BusinessException(ResponseEnum.OPERATION_FAILED, result.message());
            }
            approval.setApprovalStatus(PublishApprovalStatusEnum.APPROVED.name());
            approval.setExecutionResult(JSON.toJSONString(result == null ? null : result.data()));
            approval.setExecutedTime(LocalDateTime.now());
            approval.setUpdatedTime(LocalDateTime.now());
            publishApprovalMapper.updateById(approval);
            return decision(false, approval.getId(), PublishApprovalStatusEnum.APPROVED.name());
        } catch (RuntimeException e) {
            approval.setApprovalStatus(PublishApprovalStatusEnum.EXECUTE_FAILED.name());
            approval.setExecutionResult(JSON.toJSONString(e.getMessage()));
            approval.setExecutedTime(LocalDateTime.now());
            approval.setUpdatedTime(LocalDateTime.now());
            publishApprovalMapper.updateById(approval);
            throw e;
        }
    }

    @Override

View on GitHub (pinned to 5e758547a8)