1. 1 : /**
  2. 2 : * An error that occurs when there's an unimportant input issue
  3. 3 : */
  4. 4 : class InputError extends Error {
  5. 5 : /**
  6. 6 : * Construct an input error
  7. 7 : * @param {String} name The name of the error
  8. 8 : * @param {String} message The error message
  9. 9 : * @param {String|Number} code The code of error
  10. 10 : */
  11. 11 : constructor (name, message, code) {
  12. 12 : super(message)
  13. 13 :
  14. 14 : /**
  15. 15 : * The name of the error
  16. 16 : * @type {String}
  17. 17 : */
  18. 18 : this.name = name
  19. 19 :
  20. 20 : /**
  21. 21 : * The type of error
  22. 22 : * @type {String}
  23. 23 : */
  24. 24 : this.code = code
  25. 25 : }
  26. 26 : }
  27. 27 :
  28. 28 : module.exports = InputError