mods issueshttps://gitlab.cba.mit.edu/pub/mods/-/issues2019-09-28T20:22:52Zhttps://gitlab.cba.mit.edu/pub/mods/-/issues/7update fs.close call in deviceserver.js2019-09-28T20:22:52ZSam Calischupdate fs.close call in deviceserver.js@falcone and I ran into an issue setting up an SRM-20 today. After running deviceserver.js, we can send a job, but at the end of the job an error is thrown:
<img src='/uploads/93ec68ea9617ed2ac739c24a9bc97c96/image.png' width=500px>
T...@falcone and I ran into an issue setting up an SRM-20 today. After running deviceserver.js, we can send a job, but at the end of the job an error is thrown:
<img src='/uploads/93ec68ea9617ed2ac739c24a9bc97c96/image.png' width=500px>
The offending line is `js/deviceserver.js:103` where we run `fs.close`.
According to https://nodejs.org/api/fs.html#fs_fs_close_fd_callback, the callback is no longer optional (as of V7.0.0, but now throws `TypeError` as of V10.0.0).
So, maybe something like:
```
fs.close(file,function(err) {
if (err) {
console.log('error: '+err)
ws.send('error: '+err)
}
});
```
?