
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
samba-bo-errors
Advanced tools
Utility functions to help creating and checking against SambaBO errors.
pnpm add samba-bo-errors
createError(code: string, message: string | (T) => string, status = 500): SambaBOErrorConstructor<T>
import { createError } from 'samba-bo-errors';
const ForbiddenError = createError('FORBIDDEN', "You don't have permissions to see this.", 403);
throw new ForbiddenError();
You can configure additional extensions for the error class which should be communicated to the end user:
import { createError } from 'samba-bo-errors';
interface ForbiddenErrorExtensions {
collection: string;
field: string;
}
const ForbiddenError = createError<ForbiddenErrorExtensions>(
'FORBIDDEN',
"You don't have permissions to see this.",
403,
);
throw new ForbiddenError({
collection: 'articles',
field: 'title',
});
You can then also use those extensions to generate out the error message:
import { createError } from 'samba-bo-errors';
interface ForbiddenErrorExtensions {
collection: string;
field: string;
}
const messageConstructor = (extensions: ForbiddenErrorExtensions) =>
`You don't have permissions to see "${extensions.field}" in "${extensions.collection}".`;
const ForbiddenError = createError<ForbiddenErrorExtensions>('FORBIDDEN', messageConstructor, 403);
throw new ForbiddenError({
collection: 'articles',
field: 'title',
});
import { isSambaBOError, createError } from 'samba-bo-errors';
const ForbiddenError = createError('FORBIDDEN', "You don't have permissions to see this.", 403);
isSambaBOError(new ForbiddenError()); // true
isSambaBOError(new Error()); // false
FAQs
Create consistent error objects around the codebase
We found that samba-bo-errors demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.