{"record":{"id":"932b4cc5588edb64","repo":"paascloud/paascloud-master","slug":"mdc10021002","errorCode":"MDC10021002","errorMessage":"MDC10021002","messagePattern":"MDC10021002","errorType":"error_code","errorClass":"MdcBizException","httpStatus":null,"severity":"error","filePath":"paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/MdcAddressServiceImpl.java","lineNumber":36,"sourceCode":" * @author paascloud.net @gmail.com\n */\n@Service\n@Transactional(rollbackFor = Exception.class)\npublic class MdcAddressServiceImpl implements MdcAddressService {\n\t@Resource\n\tprivate MdcAddressQueryFeignApi mdcAddressQueryFeignApi;\n\n\t@Override\n\t@Transactional(readOnly = true, rollbackFor = Exception.class)\n\tpublic AddressDTO getAddressById(Long addressId) {\n\t\tPreconditions.checkArgument(addressId != null, \"地址ID不能为空\");\n\t\tWrapper<AddressDTO> wrapper = mdcAddressQueryFeignApi.getById(addressId);\n\n\t\tif (wrapper == null) {\n\t\t\tthrow new MdcBizException(ErrorCodeEnum.GL99990002);\n\t\t}\n\t\tif (wrapper.error()) {\n\t\t\tthrow new MdcBizException(ErrorCodeEnum.MDC10021002);\n\t\t}\n\t\treturn wrapper.getResult();\n\t}\n}\n","sourceCodeStart":18,"sourceCodeEnd":41,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/MdcAddressServiceImpl.java#L18-L41","documentation":"MDC10021002 is thrown by MdcAddressServiceImpl.getAddressById when the Feign response wrapper from mdcAddressQueryFeignApi.getById reports an error (wrapper.error() is true). It signals that the remote address-lookup service returned a failure rather than a valid AddressDTO. It is a downstream/response-error condition, distinct from the null-wrapper (GL99990002) case.","triggerScenarios":"Calling getAddressById(addressId) when the remote mdc address service responds with an error status inside the Wrapper (e.g. the addressId does not resolve, or the remote service returns its own business-error envelope).","commonSituations":"Address service is degraded or misconfigured downstream; caller passes an addressId that the remote service cannot resolve; Feign circuitry returns an error wrapper during partial outages.","solutions":["Check the downstream mdc address service logs for the underlying error returned in the Wrapper","Verify the addressId exists in the mdc_address table before calling","Confirm Feign endpoints and service registration for mdcAddressQueryFeignApi are correct","Add a fallback/default address when the wrapper is an error"],"exampleFix":"// before\nWrapper<AddressDTO> wrapper = mdcAddressQueryFeignApi.getById(addressId);\nif (wrapper.error()) {\n    throw new MdcBizException(ErrorCodeEnum.MDC10021002);\n}\n// after\nWrapper<AddressDTO> wrapper = mdcAddressQueryFeignApi.getById(addressId);\nif (wrapper == null || wrapper.error()) {\n    logger.warn(\"address lookup failed for id={}, falling back\", addressId);\n    return defaultAddress();\n}","handlingStrategy":"try-catch","validationCode":"if (addressId == null || addressId <= 0) { throw new IllegalArgumentException(\"addressId required\"); }","typeGuard":"boolean isValid = wrapper != null && !wrapper.error() && wrapper.getResult() != null;","tryCatchPattern":"try { Wrapper<AddressDTO> w = mdcAddressQueryFeignApi.getById(id); if (w == null || w.error()) throw new MdcBizException(ErrorCodeEnum.MDC10021002); return w.getResult(); } catch (MdcBizException e) { logger.warn(\"address lookup failed: {}\", e.getMessage()); return defaultAddress(); }","preventionTips":["Validate the address id before the RPC","Log the Wrapper error code/message to expose the downstream cause","Provide a fallback address for degraded mode"],"tags":["feign","rpc","remote-service-error"],"backgroundTag":"api-error-response","analyzedSha":"781281a9503332ed3cef44ea618349d14230a127","analyzedAt":"2026-09-10T10:59:02.070Z","contentChangedAt":"2026-09-10T10:59:02.070Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}