mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-25 14:11:02 +03:00
fix(web-test): show detailed message in fillFields error instead of error code
Previously fillFields errors showed only the error code (e.g. "not_found"), making it ambiguous whether the field or the value was not found. Now shows the message (e.g. 'Value "X" not found') when available. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
55ab172ba4
commit
6cb54a8f96
@@ -1434,7 +1434,7 @@ export async function fillFields(fields) {
|
|||||||
const formData = await page.evaluate(readFormScript(formNum));
|
const formData = await page.evaluate(readFormScript(formNum));
|
||||||
const failed = results.filter(r => r.error);
|
const failed = results.filter(r => r.error);
|
||||||
if (failed.length > 0) {
|
if (failed.length > 0) {
|
||||||
const details = failed.map(f => ` ${f.field}: ${f.error}${f.available ? ' (available: ' + f.available.join(', ') + ')' : ''}`).join('\n');
|
const details = failed.map(f => ` ${f.field}: ${f.message || f.error}${f.available ? ' (available: ' + f.available.join(', ') + ')' : ''}`).join('\n');
|
||||||
throw new Error(`fillFields: ${failed.length} of ${results.length} field(s) failed:\n${details}`);
|
throw new Error(`fillFields: ${failed.length} of ${results.length} field(s) failed:\n${details}`);
|
||||||
}
|
}
|
||||||
return { filled: results, form: formData };
|
return { filled: results, form: formData };
|
||||||
|
|||||||
Reference in New Issue
Block a user