{"record":{"id":"0b53fce9592911f5","repo":"Tencent/matrix","slug":"e-getmessage-0b53fc","errorCode":null,"errorMessage":"e.getMessage()","messagePattern":"e\\.getMessage\\(\\)","errorType":"exception","errorClass":"TaskExecuteException","httpStatus":null,"severity":"error","filePath":"matrix/matrix-android/matrix-apk-canary/src/main/java/com/tencent/matrix/apk/model/task/UnusedAssetsTask.java","lineNumber":211,"sourceCode":"            TaskResult taskResult = TaskResultFactory.factory(type, TaskResultFactory.TASK_RESULT_TYPE_JSON, config);\n            long startTime = System.currentTimeMillis();\n            File assetDir = new File(inputFile, ApkConstants.ASSETS_DIR_NAME);\n            findAssetsFile(assetDir);\n            generateAssetsSet(assetDir.getAbsolutePath());\n            Log.i(TAG, \"find all assets count: %d\", assetsPathSet.size());\n            decodeCode();\n            Log.i(TAG, \"find reference assets count: %d\", assetRefSet.size());\n            assetsPathSet.removeAll(assetRefSet);\n            JsonArray jsonArray = new JsonArray();\n            for (String name : assetsPathSet) {\n                jsonArray.add(name);\n            }\n            ((TaskJsonResult) taskResult).add(\"unused-assets\", jsonArray);\n            taskResult.setStartTime(startTime);\n            taskResult.setEndTime(System.currentTimeMillis());\n            return taskResult;\n        } catch (Exception e) {\n            throw new TaskExecuteException(e.getMessage(), e);\n        }\n    }\n}\n","sourceCodeStart":193,"sourceCodeEnd":215,"githubUrl":"https://github.com/Tencent/matrix/blob/3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7/matrix/matrix-android/matrix-apk-canary/src/main/java/com/tencent/matrix/apk/model/task/UnusedAssetsTask.java#L193-L215","documentation":"UnusedAssetsTask.call() wraps any Exception thrown while scanning the unzipped APK for unused assets into a TaskExecuteException, using e.getMessage() as the message. The original exception is kept as the cause. It is a generic execution-failure wrapper, so the real reason is in the cause.","triggerScenarios":"Any exception during execute() of UnusedAssetsTask: IO errors reading files under the unzip path, failures building the file graph, or JSON result assembly errors.","commonSituations":"Corrupted or partially extracted APK directory, unreadable asset files (permissions), disk errors, or a bug in a downstream task step during Gradle APK analyses.","solutions":["Read the cause (TaskExecuteException.getCause()) — the message is just the cause's getMessage() and may be null","Verify the APK was fully unzipped and the unzip path is a readable directory","Check file permissions of the extracted assets","Re-run the ApkChecker job with a fresh unzipped APK directory"],"exampleFix":"// before\nthrow new TaskExecuteException(e.getMessage(), e);\n// after\nthrow new TaskExecuteException(\"UnusedAssetsTask failed: \" + e, e);","handlingStrategy":"try-catch","validationCode":"File unzipDir = new File(config.getUnzipPath());\nif (unzipDir == null || !unzipDir.isDirectory() || !unzipDir.canRead()) throw new IllegalStateException(\"unzip path invalid\");","typeGuard":null,"tryCatchPattern":"try {\n    TaskResult r = task.call();\n} catch (TaskExecuteException e) {\n    Throwable cause = e.getCause();\n    log.error(\"unused-assets failed\", cause != null ? cause : e);\n}","preventionTips":["Always run the unzip task before asset analysis","Check disk space and permissions on CI","Log full stack trace, not just getMessage()"],"tags":["android","apk-analysis","exception-wrapper"],"backgroundTag":"file-read-failed","analyzedSha":"3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7","analyzedAt":"2026-09-08T08:01:39.722Z","contentChangedAt":"2026-09-08T08:01:39.722Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}