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.
@dazn/chaos-squirrel-attack-throw-error
Advanced tools
Chaos Squirrel attack to throw an exception
Causes an error to be thrown - either directly or via setImmediate
causing uncaught exception.
Parameter | Type | Default | Description |
---|---|---|---|
errorClass | ErrConstructor | Error | Instance of that class will be thrown. The class should extend Error . |
errorMessage | string | chaos-squirrel: attack-throw-error | Error message |
uncaughtException | boolean | false | Flag that decides if uncaught exception is thrown |
Immediately thrown error
import ThrowErrorAttack from '@dazn/chaos-squirrel-attack-throw-error';;
class CustomError extends Error {
constructor(message?: string) {
super(message);
}
}
const errorMessage = 'Chaos!';
const attack = new ThrowErrorAttack({
errorClass: CustomError,
errorMessage
});
try {
attack.start();
} catch (err) {
err instanceof CustomError // true
console.log(err.message) // Chaos!
}
Uncaught exception
import ThrowErrorAttack from '@dazn/chaos-squirrel-attack-throw-error';
const attack = new ThrowErrorAttack({ uncaughtException: true });
process.on('uncaughtException', (err) => {
err instanceof Error // true
console.log(err.message) // chaos-squirrel: attack-throw-error
})
attack.start();
console.log('Still alive');
// Uncaught exception is thrown via setImmediate so "check" phase
Stopping uncaught exception
import ThrowErrorAttack from '@dazn/chaos-squirrel-attack-throw-error';
const attack = new ThrowErrorAttack({ uncaughtException: true });
attack.start();
attack.stop();
// nothing bad is gonna happen
To cause an uncaught exception an error is being thrown from setImmediate
callback. See docs.
0.10.1 (2021-07-20)
Note: Version bump only for package @dazn/chaos-squirrel
FAQs
Chaos Squirrel attack to throw an exception
We found that @dazn/chaos-squirrel-attack-throw-error demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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
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.