{"record":{"id":"1a3eed54be110341","repo":"Tencent/matrix","slug":"taskexecuteexception-wrapping-e-getmessage","errorCode":null,"errorMessage":"TaskExecuteException wrapping e.getMessage()","messagePattern":"TaskExecuteException wrapping 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/FindNonAlphaPngTask.java","lineNumber":162,"sourceCode":"                    }\n                }\n            });\n\n            JsonArray jsonArray = new JsonArray();\n            for (Pair<String, Long> entry : nonAlphaPngList) {\n                if (!Util.isNullOrNil(entry.getFirst())) {\n                    JsonObject jsonObject = new JsonObject();\n                    jsonObject.addProperty(\"entry-name\", entry.getFirst());\n                    jsonObject.addProperty(\"entry-size\", entry.getSecond());\n                    jsonArray.add(jsonObject);\n                }\n            }\n            ((TaskJsonResult) taskResult).add(\"files\", 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":144,"sourceCodeEnd":166,"githubUrl":"https://github.com/Tencent/matrix/blob/3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7/matrix/matrix-android/matrix-apk-canary/src/main/java/com/tencent/matrix/apk/model/task/FindNonAlphaPngTask.java#L144-L166","documentation":"FindNonAlphaPngTask.call() wraps any Exception thrown during PNG scanning into TaskExecuteException with the original e.getMessage(). Common wrapped causes are IOExceptions reading PNG files and NumberFormatException from parsing the DOWN-LIMIT-SIZE param (though the latter is usually caught and logged). This is a generic catch-all at the end of call().","triggerScenarios":"Any uncaught exception inside call(): file I/O failures while reading PNGs in the unzipped directory, malformed/locked files, or unexpected runtime errors during image parsing.","commonSituations":"Permission issues reading extracted files; partially unzipped/corrupt APK; param MIN-LIMIT-SIZE given as non-numeric (caught earlier and logged, but downstream issues remain).","solutions":["Read the nested exception (cause) and original message to identify the underlying failure.","Re-unzip the APK to ensure files are complete and readable (`chmod -R u+r <dir>`).","Check task params: ensure values like MIN-LIMIT-SIZE are valid numbers (in KB).","Run the task with logging enabled to pinpoint which file caused the failure."],"exampleFix":"// before\nparams.put(JobConstants.PARAM_MIN_SIZE_IN_KB, \"ten\");\n// after\nparams.put(JobConstants.PARAM_MIN_SIZE_IN_KB, \"10\");","handlingStrategy":"try-catch","validationCode":"// validate numeric params before running\nString minSize = params.get(JobConstants.PARAM_MIN_SIZE_IN_KB);\nif (minSize != null && !minSize.matches(\"\\\\d+\")) {\n    throw new IllegalArgumentException(\"MIN-LIMIT-SIZE must be a number in KB: \" + minSize);\n}","typeGuard":null,"tryCatchPattern":"try {\n    taskResult = findNonAlphaPngTask.call();\n} catch (TaskExecuteException e) {\n    Throwable cause = e.getCause();\n    log.severe(\"PNG scan failed: \" + e.getMessage() + \" cause=\" + cause);\n    // re-unzip / fix perms, then retry once\n}","preventionTips":["Inspect e.getCause() — the message is just the wrapped original.","Ensure the unzipped APK files are complete and readable (permissions, disk space).","Pass numeric values for size-related params (KB)."],"tags":["android","apk-checker","png","wrapped-exception"],"backgroundTag":"invalid-argument-format","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"}