Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@foundry-ai/api-errors
Advanced tools
Common errors that can be thrown and caught reliably across services
Common errors that can be thrown and caught reliably across services
import { InternalError, NotFoundError } from '@foundry-ai/api-errors'
function doWork(callback) {
try {
performImpossibleTask(callback)
} catch {
throw new InternalError()
}
}
function findPuppy(puppyId, callback) {
queryForPuppy(puppyId, function(error, puppy) {
if (!puppy) throw new NotFoundError('failed to find puppy')
callback(puppy)
})
}
All Error classes can be instantiated with custom message
s and status
es
(given as parameters in that order), but come with sensible defaults.
Error Class | .message | .code | .type |
---|---|---|---|
BadRequestError | 'Bad Request' | 400 | 'bad_request_error' |
AuthenticationError | 'Unauthorized' | 401 | 'authentication_error' |
ForbiddenError | 'Forbidden' | 403 | 'forbidden_error' |
NotFoundError | 'Not Found' | 404 | 'not_found_error' |
ConflictError | 'Conflict' | 409 | 'conflict_error' |
RateLimitError | 'Too many requests' | 429 | 'rate_limit_error' |
InternalError | 'Internal Server Error' | 500 | 'internal_server_error' |
FAQs
Common errors that can be thrown and caught reliably across services
The npm package @foundry-ai/api-errors receives a total of 1 weekly downloads. As such, @foundry-ai/api-errors popularity was classified as not popular.
We found that @foundry-ai/api-errors demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.