JSFiddle - React, Tailwind, and code Playground
JavaScript
function CustomError() {
this.message = 'Custom Error';
this.y = {
a: 1,
b: 2
};
}
try {
throw new Error('Default Error');
} catch (pError) {
console.log(pError.message);
}