We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b1fdfa5 + 7e44948 commit c37e8e4Copy full SHA for c37e8e4
lib/adapters/file.js
@@ -20,9 +20,6 @@ class FileAdapter {
20
}
21
read (room, tick, callback) {
22
const file = this.getFilePath(room, tick)
23
- if (!fs.existsSync(file)) {
24
- return Promise.resolve().asCallback(callback)
25
- }
26
return Promise.resolve()
27
.then(data => fs.readFileAsync(file))
28
.then(data => zlib.gunzipAsync(data, 'utf8'))
lib/adapters/sqlite.js
@@ -42,7 +42,7 @@ class SqliteAdapter {
42
try {
43
const record = await History.findOne({ where: { room, tick } })
44
if (!record) {
45
- return null
+ throw new Error('Record not found')
46
47
const data = JSON.parse(await gunzip(record.data, 'utf8'))
48
if (typeof callback === 'function') callback(null, data)
0 commit comments