aldrin312 / AutoCommentingTool

BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

Add Error handling or check filepath before proceed readfile. #3

Closed fadingNA closed 1 month ago

fadingNA commented 1 month ago

https://github.com/aldrin312/AutoCommentingTool/blob/0a92be444b052f54d79ada889570c9e01a54b887/index.js#L34

Better approach to have file path validation first before proceed read file other can crash the application.

Also good idea if we have error handling here.

aldrin312 commented 1 month ago

Thank you, I didn't think about to check if the files are valid or not. Possibly I also need to check if they are the right file formats, like make sure files ends in .cpp, .js, .ts etc...

fadingNA commented 1 month ago

Yes I agreed, because we need to make sure we can handle docx, pdf, those unstrcutred format..

aldrin312 commented 1 month ago

For now added the error handing for invalid files (exist or not).