Skip to content

Commit

Permalink
fix: remove misleading error message #25
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesjo committed Oct 3, 2018
1 parent fc74ec1 commit f398238
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ function saveSessionForDisplayToDb(sessionToHandle, connectedDisplaysId, windowL
// check if entry exists and update
db.get(sessionToHandle, (err, sessionData) => {
if (err) {
reject(err);
// NOTE: we're not failing because, the case is probably that there is no session file yet
console.log(`saveSessionForDisplayToDb: no session file present yet for "${sessionToHandle}", creating a new one...`);
}

if (!sessionData) {
Expand Down
4 changes: 2 additions & 2 deletions lib/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ function mkdirSync(dirPath) {
}
}

function mkfileSync(dirPath) {
function mkfileSync(filePath) {
try {
fs.mkdirSync(dirPath);
fs.writeFileSync(filePath, { flag: 'wx' });
} catch (err) {
if (err.code !== 'EEXIST') {
throw err;
Expand Down

0 comments on commit f398238

Please sign in to comment.