Resort to simple string conversion when JSON.stringify fails
import { stringify } from 'protective';
const something = { key: 'Balue' };
something.circular = something;
JSON.stringify(something, null, 2); // TypeError: Converting circular structure to JSON
stringify(something, null, 2); // '[object Object]'
Add arguments to function error messages
import { verbose } from 'protective';
function myFunction() {
throw new Error('This is an error');
}
myFunction('one', 'two'); // Error: This is an error
verbose(myFunction)('one', 'two'); // Error: This is an error. Arguments: "one", "two"