
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@sealsystems/assert-mongo-error
Advanced tools
Test for a servere mongodb error and handle it by exiting the process, throwing a new generated @sealsystems/error
error object or just ignore the error.
Default list of severe mongodb error codes to exit:
Name | Code |
---|---|
InternalError | 1 |
HostUnreachable | 6 |
HostNotFound | 7 |
NetworkTimeout | 89 |
SocketException | 9001 |
UnknownError | 8 |
ProtocolError | 17 |
IllegalOpMsgFlag | 223 |
UserNotFound | 11 |
Unauthorized | 13 |
AuthenticationFailed | 18 |
InvalidSSLConfiguration | 140 |
SSLHandshakeFailed | 141 |
OutOfDiskSpace | 14031 |
$ npm install @sealsystems/assert-mongo-error
First you need to add a reference to @sealsystems/assert-mongo-error within your application, then call the assert
function in the callback of every mongodb call.
const assertMongoError = require('@sealsystems/assert-mongo-error');
yourCollection.find({}, (findError, cursor) => {
assertMongoError.assert(findError);
...
});
Test for a servere mongodb error. The function has three outcomes:
@sealsystems/error
. The original mongodb error is chained to the new error.assertMongoError.assert(error, message, code, metadata);
Parameters:
error object mandatory The error object to test
message string optional Message used for creating a new error object
code number optional Code used for creating a new error object
metadata object optional Metadata used for creating a new error object
Use the setCodes
function to set a new list of error codes. This needs to be done only once, e.g. at startup. The new list is available instantly throughout the whole node process.
const assertMongoError = require('@sealsystems/assert-mongo-error');
assertMongoError.setCodes([1,2,3]);
...
assertMongoError.assert(mongoErrorObject);
To build this module use roboter.
$ bot
FAQs
Throws on a servere mongodb error.
We found that @sealsystems/assert-mongo-error demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.