We should be aware of a case where a database is located in a location which is not existing in the first place.
Considering, we're trying to open a database:
root = require("levelup")("./db/root.db");
whereas ./db/ is not existing.
A dubious error is thrown, but does not explain the allocation is invalid because the directory itself is not existing:
OpenError: IO error: ./db/root.db/LOCK: No such file or directory
at [..]/levelup.js:113:25
I propose a reverse-lookup of the directory-path (cherry-picking ftw) and either an error being thrown explaining the problem further or the directories to the target path being created recursively.
We should be aware of a case where a database is located in a location which is not existing in the first place.
Considering, we're trying to open a database:
whereas ./db/ is not existing.
A dubious error is thrown, but does not explain the allocation is invalid because the directory itself is not existing:
I propose a reverse-lookup of the directory-path (cherry-picking ftw) and either an error being thrown explaining the problem further or the directories to the target path being created recursively.