Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
@fuel-ts/errors
Advanced tools
Error class and error codes that the fuels-ts library throws
@fuel-ts/errors
@fuel-ts/errors is a sub-module for interacting with Fuel.
This package contains core utilities regarding throwing errors internally inside of the fuels-ts
SDK.
yarn add @fuel-ts/errors
# or
npm add @fuel-ts/errors
import { FuelError, ErrorCodes } from "@fuel-ts/error";
export function singleImport() {
throw new FuelError(FuelError.CODES.INVALID_URL, "Invalid URL");
}
export function multipleImports() {
throw new FuelError(ErrorCodes.INVALID_URL, "Invalid URL");
}
import { FuelError, Provider } from "fuels";
type Locale = "PT_BR" | "BS_BA";
const currentLocale: Locale = "PT_BR";
const i18nDict = {
PT_BR: {
[FuelError.CODES.INVALID_URL]: "Endereço inválido",
[FuelError.CODES.INSUFFICIENT_BALANCE]: "Saldo insuficiente",
},
BS_BA: {
[FuelError.CODES.INVALID_URL]: "Nevažeća adresa",
[FuelError.CODES.INSUFFICIENT_BALANCE]: "Nedovoljan balans",
},
};
function translateError(e: unknown) {
const { code } = FuelError.parse(e);
return i18nDict[currentLocale][code];
}
(function main() {
try {
const p = new Provider("0004:tƨoʜlɒɔol//:qttʜ");
console.log(p);
} catch (e) {
const prettyError = translateError(e);
console.log({ prettyError });
}
})();
In order to contribute to @fuel-ts/errors
, please see the main fuels-ts monorepo.
The @fuel-ts/errors
changelog can be found at CHANGELOG.
The primary license for @fuel-ts/errors
is Apache 2.0
, see LICENSE.
FAQs
Error class and error codes that the fuels-ts library throws
The npm package @fuel-ts/errors receives a total of 26,583 weekly downloads. As such, @fuel-ts/errors popularity was classified as popular.
We found that @fuel-ts/errors demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.