{"record":{"id":"0c95a17400f1ff8b","repo":"binarywang/WxJava","slug":"errorcode-errormsg-0c95a1","errorCode":null,"errorMessage":"错误代码：{errorCode}, 错误信息：{errorMsg}","messagePattern":"错误代码：(.+?), 错误信息：(.+?)","errorType":"exception","errorClass":"WxErrorException","httpStatus":null,"severity":"error","filePath":"weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/okhttp/OkHttpMediaDownloadRequestExecutor.java","lineNumber":51,"sourceCode":"  public File execute(String uri, String queryParam, WxType wxType) throws WxErrorException, IOException {\n    if (queryParam != null) {\n      if (uri.indexOf('?') == -1) {\n        uri += '?';\n      }\n      uri += uri.endsWith(\"?\") ? queryParam : '&' + queryParam;\n    }\n\n    //得到httpClient\n    OkHttpClient client = requestHttp.getRequestHttpClient();\n\n    Request request = new Request.Builder().url(uri).get().build();\n\n    Response response = client.newCall(request).execute();\n\n    String contentType = response.header(\"Content-Type\");\n    if (contentType != null && contentType.startsWith(\"application/json\")) {\n      // application/json; encoding=utf-8 下载媒体文件出错\n      throw new WxErrorException(WxError.fromJson(response.body().string(), wxType));\n    }\n\n    String fileName = HttpResponseProxy.from(response).getFileName();\n    if (StringUtils.isBlank(fileName)) {\n      return null;\n    }\n\n    String baseName = FilenameUtils.getBaseName(fileName);\n    if (StringUtils.isBlank(fileName) || baseName.length() < 3) {\n      baseName = String.valueOf(System.currentTimeMillis());\n    }\n\n    File file = File.createTempFile(\n      baseName, \".\" + FilenameUtils.getExtension(fileName), super.tmpDirFile\n    );\n\n    try (BufferedSink sink = Okio.buffer(Okio.sink(file))) {\n      sink.writeAll(response.body().source());","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/binarywang/WxJava/blob/1c43293a3c2c9d7e91304b6d037fb017f680d0c6/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/okhttp/OkHttpMediaDownloadRequestExecutor.java#L33-L69","documentation":"Error \"错误代码：{errorCode}, 错误信息：{errorMsg}\" thrown in binarywang/WxJava.","triggerScenarios":"Thrown at weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/okhttp/OkHttpMediaDownloadRequestExecutor.java:51 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["根据返回的 errorCode 对照微信接口文档确认具体错误原因并修正请求参数。","检查 access_token 是否有效、media_id 是否存在且未过期。"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1c43293a3c2c9d7e91304b6d037fb017f680d0c6","analyzedAt":"2026-08-14T02:29:11.060Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}