Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@packt/error-custom
Advanced tools
Extends the JavaScript Error object with custom properties.
Calls parent constructor to set the error message and adds code, errorCode, manuallyThrown and innerException custom properties.
Logs the final object using passed function, Elastic URL or Debug
library with the tag error-custom
.
const error = new ErrorCustom(message, statusCode, errorCode, baseError, logFunction);
message
Error message to set on the Error objectstatusCode
HTTP status codeerrorCode
The specific error code as defined in documentationbaseError
Optional base exception to be included as innerException propertylogFunction
Optional function to log the error with. If not supplied, debug library will be used
to log to the console with the tag error-custom
. If a string is provided that is a
URL, it will be used to send to that URL with ElasticSearch client in Winston format.Functionality can be modified with various environment variables:
ELASTIC_LOGGING_URL
: A url to Elastic that will send errors there as well as using Debug
to log locally to stdout.ELASTIC_PING_TIMEOUT
: An integer specifying ping timeout in milliseconds (defaults to 2000).ELASTIC_REQUEST_TIMEOUT
: An integer specifying request timeout in milliseconds (defaults to 2000).ELASTIC_FLUSH_INTERVAL
: An integer specifying flush interval in milliseconds (defaults to 500).FAQs
Extends the JavaScript Error object with custom properties.
The npm package @packt/error-custom receives a total of 2 weekly downloads. As such, @packt/error-custom popularity was classified as not popular.
We found that @packt/error-custom demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.