aldrin312 / AutoCommentingTool

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

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

Closed fadingNA closed 2 months ago

fadingNA commented 2 months 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 2 months 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 2 months ago

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

aldrin312 commented 2 months ago

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