Handle IOException in DB module if file doesn't exist
yutotakano opened this issue · 0 comments
yutotakano commented
The CSV module logs an error and returns an empty list if the target file doesn't for read. However, the DB module blindly calls BS.readFile
and is prone to throwing an IOException if the file doesn't exist.
Real life case being if status.json
doesn't exist on start up (which is sure to happen on the first time), the bot will fail to start at all. The status file should be either created empty, or ignored and operation continued.