Utility for creating custom JavaScript errors