Custom error functions in JavaScript.