
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@qvac/error
Advanced tools
This library provides standardized error handling capabilities for all QVAC libraries. It ensures consistency in error reporting, serialization, and handling across the entire QVAC ecosystem.
npm i git+https://github.com/tetherto/qvac-lib-error-base.git
const { QvacErrorBase, addCodes } = require('@qvac/error-base')
// Create your own error class extending the base
class QvacErrorCustom extends QvacErrorBase {
constructor(code, adds) {
super(code, adds)
}
}
// Define your error codes (reserve at least 1000 codes per library)
const ERR_CODES = Object.freeze({
VALIDATION_ERROR: 1000,
CONNECTION_ERROR: 1001,
TIMEOUT_ERROR: 1002
})
// Register your error codes and their messages
addCodes({
[ERR_CODES.VALIDATION_ERROR]: {
name: 'VALIDATION_ERROR',
message: (...field) => `Validation failed for field: ${field}`
},
[ERR_CODES.CONNECTION_ERROR]: {
name: 'CONNECTION_ERROR',
message: 'Failed to establish connection'
},
[ERR_CODES.TIMEOUT_ERROR]: {
name: 'TIMEOUT_ERROR',
message: (timeout) => `Operation timed out after ${timeout}ms`
}
})
// Using your custom errors
try {
// Some operation that fails
throw new QvacErrorCustom(ERR_CODES.VALIDATION_ERROR, 'username')
} catch (error) {
console.error(error.message) // "Validation failed for field: username"
console.error(error.code) // 1000
console.error(error.name) // "VALIDATION_ERROR"
}
QvacErrorBaseBase error class that extends the native Error.
new QvacErrorBase(code, adds)
code (Number): The error codeadds (Array|String): Additional parameters to format the error messageaddCodes(codes)Register new error codes.
codes (Object): Map of error codes to their definitionsgetRegisteredCodes()Get all registered error codes and their definitions.
isCodeRegistered(code)Check if a code is already registered.
code (Number): The error code to checkINTERNAL_ERROR_CODESReserved internal error codes:
UNKNOWN_ERROR_CODE: 0INVALID_CODE_DEFINITION: 1ERROR_CODE_ALREADY_EXISTS: 2MISSING_ERROR_DEFINITION: 3After cloning, run npm install. If npm lifecycle scripts are disabled, also run npm run prepare to initialize git hooks.
QvacErrorBase with a library-specific class name (e.g., QvacErrorAgent)FAQs
Base error handling library for QVAC
We found that @qvac/error demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.