Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Inspired by and adapted from the example code in this article by Kent C. Dodds
Since TypeScript 4.4, catch clause variables default to the unknown
type. This library provides a
zero-dependency utility function which allows you to extract the error message in a type-safe manner
when the variable is of type Error
.
Install the package in your project:
# NPM
npm install catch-safe
# Yarn
yarn add catch-safe
# PNPM
pnpm add catch-safe
Import the getErrorMessage
function from the catch-safe
module and use it to get the error
message (if it exists) from a catch block variable :
import { getErrorMessage } from 'catch-safe'
async function someAsyncFunction() {
try {
await runAsyncTask()
} catch (err) {
throw new Error(getErrorMessage(err))
}
}
FAQs
Zero-dependency type-safe error handling utility
We found that catch-safe demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.