mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-17 03:01:19 +00:00
log error if state file is truncacted
This commit is contained in:
parent
3d1c3a1d27
commit
cbd3e32143
1 changed files with 3 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
fs = require "fs"
|
||||
logger = require "logger-sharelatex"
|
||||
|
||||
module.exports = SafeReader =
|
||||
|
||||
|
@ -21,4 +22,6 @@ module.exports = SafeReader =
|
|||
fs.read fd, buff, 0, buff.length, 0, (err, bytesRead, buffer) ->
|
||||
return callbackWithClose(err) if err?
|
||||
result = buffer.toString(encoding, 0, bytesRead)
|
||||
if bytesRead is size
|
||||
logger.error file:file, size:size, bytesRead:bytesRead, "file truncated"
|
||||
callbackWithClose(null, result)
|
||||
|
|
Loading…
Reference in a new issue