Skip to content

GantMan/over-armour

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Protect Functions and Classes from Crashes in Prod

npm version

Wrap an entire class in try/catch

Quickly protect an entire class from causing an exception with fortify method

Example Protection:

const iCanError = new CrashyApi()
const protector = new OverArmour()

// for PROD!
protector.fortify(iCanError) 

iCanError.failSauce('I will fail but not crash')
console.log('Still got here!')

const workingWithAsync = async () => {
  await iCanError.failSauceAsync('No try catches existed here!')
  console.log('Got here, too!')
}
workingWithAsync()

console.log('EOF!')

About

Rage Against the Crash

Resources

Stars

Watchers

Forks

Packages

No packages published