design.md icon indicating copy to clipboard operation
design.md copied to clipboard

ENOENT: no such file or directory error when DESIGN.md is missing

Open Zarl-prog opened this issue 5 months ago • 1 comments

The CLI tool crashes with an unhandled ENOENT error if the expected DESIGN.md file is not present in the current working directory. Instead of crashing with a stack trace, the tool should ideally look for a default file, create one, or output a user-friendly error message explaining how to initialize or provide the missing file.Steps to ReproduceRun the tool via npx (or globally) in a directory that does not contain a DESIGN.md file.Observe the unhandled file read error crash.Expected BehaviorThe tool should gracefully handle the missing file by either:Prompting the user to create a DESIGN.md file.Automatically generating a template DESIGN.md file.Providing a clear error message (e.g., "Error: DESIGN.md not found. Please create this file or specify a path.") instead of dumping a Node.js stack trace.Environment & Stack TraceTool: @google/design.mdError Log:json{ "error": "FILE_READ_ERROR", "message": "ENOENT: no such file or directory, open 'DESIGN.md'", "path": "DESIGN.md" } Use code with caution.textERROR ENOENT: no such file or directory, open 'DESIGN.md' at readFileSync (node:fs:441:20) at readInput (.npm/_npx/9cb06364208d5c89/node_modules/@google/design.md/dist/index.js:24123:12) at Object.run (.npm/_npx/9cb06364208d5c89/node_modules/@google/design.md/dist/index.js:24260:28) at runCommand (.npm/_npx/9cb06364208d5c89/node_modules/@google/design.md/dist/index.js:23969:26)

Zarl-prog avatar Jun 26 '26 18:06 Zarl-prog

https://github-production-user-asset-6210df.s3.amazonaws.com/230791565/613373997-ad6285aa-1975-49a9-904e-86ab9300232b.gif?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20260626%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260626T091555Z&X-Amz-Expires=300&X-Amz-Signature=db4bfd0f602fb95140650f406eb0960c1ee43e810e63d6746466ef128b251505&X-Amz-SignedHeaders=host&response-content-type=image%2Fgif

Ka77ius avatar Jun 27 '26 08:06 Ka77ius