Stop throwing generic error in javascript

Throw error in javascript using custom error class and handle it properly

errorscustom