
Research
/Security News
Chrome and Firefox Extensions Posing as Free VPNs Add Clipboard Stealers via Malicious Updates
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.
@xylabs/error
Advanced tools
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Using npm:
npm install {{name}}
Using yarn:
yarn add {{name}}
Using pnpm:
pnpm add {{name}}
Using bun:
bun add {{name}}
See the LICENSE file for license rights and limitations (LGPL-3.0-only).
### .temp-typedoc
### functions
### <a id="assertError"></a>assertError
function assertError(
value,
assert,
defaultMessage): undefined;
Throws an Error based on the assert configuration when a value fails validation.
unknown
The value being validated
AssertConfig | undefined
Assertion config controlling the error message
string
Fallback message if no custom message is provided
undefined
### <a id="handleError"></a>handleError
function handleError<T>(error, handler): T;
Invokes the handler if the value is an Error, otherwise re-throws it.
T
any
The caught value to inspect
(error) => T
Callback invoked with the Error if it is one
T
The handler's return value
### <a id="handleErrorAsync"></a>handleErrorAsync
function handleErrorAsync<T>(error, handler): Promise<T>;
Async version of handleError. Invokes the async handler if the value is an Error, otherwise re-throws it.
T
any
The caught value to inspect
(error) => Promise<T>
Async callback invoked with the Error if it is one
Promise<T>
The handler's resolved return value
### type-aliases
### <a id="AssertConfig"></a>AssertConfig
type AssertConfig = string | AssertCallback | boolean;
Configuration for assertion behavior: a static message string, a boolean toggle, or a callback.
FAQs
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
The npm package @xylabs/error receives a total of 7,121 weekly downloads. As such, @xylabs/error popularity was classified as popular.
We found that @xylabs/error demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.

Security News
Rolldown paused Rust React Compiler integration after a 5MB binary size increase raised concerns about shipping React-specific code to all Vite users.