.1602452971339523:e44025270177f90149d4b7ef19055c28_69eca5b796939c95cd758ca4.69eca5f896939c95cd758d26.69eca5f8717b234dfc9edfc2:Trae CN.T(2026/4/25 19:31:04)#1
Open
666yuhan666 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题复现
通配符没匹配到文件:运行 stitch non_existent*.jpg 时,可能会显示一堆错误代码,而不是简单说"没找到文件"
只给一张图片:运行 stitch only_one.jpg 时,同样可能显示复杂错误,而不是直接说"至少需要两张图片"
API调用:用代码调用时,错误信息和命令行提示不一样
问题原因
1.
通配符处理有问题:只能处理一个通配符参数,多个参数时不管用
2.
错误提示不一致:命令行和代码调用的错误信息不一样
3.
异常没捕获好:出错时直接显示所有错误代码,不友好
4.
逻辑混乱:分不清"没找到文件"和"图片不够"的区别
修复内容
命令行工具:加了错误捕获,出错时只显示简单提示,返回错误码1
图片处理模块:修复了通配符处理,现在支持多个通配符;统一了错误提示
测试文件:加了测试用例,确保错误处理正常
修复后效果
通配符没匹配:显示"Error: No files matched the provided pattern.",返回错误码1
只给一张图:显示"Error: At least 2 images are required for stitching.",返回错误码1
API调用:和命令行显示一样的错误信息
不再显示:不再显示一堆复杂的错误代码