
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@smarterservices/error-response
Advanced tools
This module is used to format the error and send user defined error in response.
terminal
in your project root directory
.npm install
to install necessary dependencies.config/errors
subdirectory, list errors in defined-erros.json
in following structure{
"JOI": {
"ERROR_NAME": {
"code": "4000",
"message": "Joi related error message"
}
},
"ERROR_NAME": {
"code": "6000",
"message": "The error message to attach"
}
}
All joi related errors will be listed under JOI
object and other general errors will be listed as shown in the structure.
config
subdirectory and modify the following things in configuration file (i.e default.json
).
url
to attach additional url in ResponseprintError
to true if you want to print error from moduleFor example, your configuration may look like as follows:
{
"errorResponse": {
"url": "https://www.smarterservices.com/errors/",
"printError": false
}
}
formatError
to format the errorconst errorResponse = require('error-response');
const options = {
values: {
approvalSid: 'AP...',
installSid: 'AI...'
}
};
const error = errorResponse.formatError('APPROVAL_NOT_FOUND_UNDER_INSTALL', options);
To generate the above error, the error object should be as follows
{
"APPROVAL_NOT_FOUND_UNDER_INSTALL": {
"code": "6001",
"message": "approval '%approvalSid%' not found under '%installSid%'",
"status": 404
}
}
approvalSid
will be replaced by the given in options
object.statusCode
is 400, passing status in error object will override the default statusCode
.errorResponse.failAction
to wrap joi
related error.n/a
n/a
n/a
FAQs
This is a module to format error
The npm package @smarterservices/error-response receives a total of 2 weekly downloads. As such, @smarterservices/error-response popularity was classified as not popular.
We found that @smarterservices/error-response demonstrated a not healthy version release cadence and project activity because the last version was released 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.