You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

errors.go 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // Copyright (c) 2012-2014 Jeremy Latt
  2. // Copyright (c) 2014-2015 Edmund Huber
  3. // Copyright (c) 2016-2017 Daniel Oaks <daniel@danieloaks.net>
  4. // released under the MIT license
  5. package irc
  6. import (
  7. "errors"
  8. "github.com/oragono/oragono/irc/utils"
  9. )
  10. // Runtime Errors
  11. var (
  12. errAccountAlreadyRegistered = errors.New(`Account already exists`)
  13. errAccountAlreadyVerified = errors.New(`Account is already verified`)
  14. errAccountCantDropPrimaryNick = errors.New("Can't unreserve primary nickname")
  15. errAccountCreation = errors.New("Account could not be created")
  16. errAccountDoesNotExist = errors.New("Account does not exist")
  17. errAccountInvalidCredentials = errors.New("Invalid account credentials")
  18. errAccountBadPassphrase = errors.New(`Passphrase contains forbidden characters or is otherwise invalid`)
  19. errAccountNickReservationFailed = errors.New("Could not (un)reserve nick")
  20. errAccountNotLoggedIn = errors.New("You're not logged into an account")
  21. errAccountTooManyNicks = errors.New("Account has too many reserved nicks")
  22. errAccountUnverified = errors.New(`Account is not yet verified`)
  23. errAccountVerificationFailed = errors.New("Account verification failed")
  24. errAccountVerificationInvalidCode = errors.New("Invalid account verification code")
  25. errAccountUpdateFailed = errors.New(`Error while updating your account information`)
  26. errAccountMustHoldNick = errors.New(`You must hold that nickname in order to register it`)
  27. errCallbackFailed = errors.New("Account verification could not be sent")
  28. errCertfpAlreadyExists = errors.New(`An account already exists for your certificate fingerprint`)
  29. errChannelNotOwnedByAccount = errors.New("Channel not owned by the specified account")
  30. errChannelAlreadyRegistered = errors.New("Channel is already registered")
  31. errChannelNameInUse = errors.New(`Channel name in use`)
  32. errInvalidChannelName = errors.New(`Invalid channel name`)
  33. errMonitorLimitExceeded = errors.New("Monitor limit exceeded")
  34. errNickMissing = errors.New("nick missing")
  35. errNicknameInUse = errors.New("nickname in use")
  36. errNicknameReserved = errors.New("nickname is reserved")
  37. errNoExistingBan = errors.New("Ban does not exist")
  38. errNoSuchChannel = errors.New(`No such channel`)
  39. errInsufficientPrivs = errors.New("Insufficient privileges")
  40. errInvalidUsername = errors.New("Invalid username")
  41. errFeatureDisabled = errors.New(`That feature is disabled`)
  42. errBanned = errors.New("IP or nickmask banned")
  43. errInvalidParams = utils.ErrInvalidParams
  44. )
  45. // Socket Errors
  46. var (
  47. errNoPeerCerts = errors.New("Client did not provide a certificate")
  48. errNotTLS = errors.New("Not a TLS connection")
  49. errReadQ = errors.New("ReadQ Exceeded")
  50. )
  51. // String Errors
  52. var (
  53. errCouldNotStabilize = errors.New("Could not stabilize string while casefolding")
  54. errStringIsEmpty = errors.New("String is empty")
  55. errInvalidCharacter = errors.New("Invalid character")
  56. )
  57. // Config Errors
  58. var (
  59. ErrDatastorePathMissing = errors.New("Datastore path missing")
  60. ErrInvalidCertKeyPair = errors.New("tls cert+key: invalid pair")
  61. ErrLimitsAreInsane = errors.New("Limits aren't setup properly, check them and make them sane")
  62. ErrLineLengthsTooSmall = errors.New("Line lengths must be 512 or greater (check the linelen section under server->limits)")
  63. ErrLoggerExcludeEmpty = errors.New("Encountered logging type '-' with no type to exclude")
  64. ErrLoggerFilenameMissing = errors.New("Logging configuration specifies 'file' method but 'filename' is empty")
  65. ErrLoggerHasNoTypes = errors.New("Logger has no types to log")
  66. ErrNetworkNameMissing = errors.New("Network name missing")
  67. ErrNoFingerprintOrPassword = errors.New("Fingerprint or password needs to be specified")
  68. ErrNoListenersDefined = errors.New("Server listening addresses missing")
  69. ErrOperClassDependencies = errors.New("OperClasses contains a looping dependency, or a class extends from a class that doesn't exist")
  70. ErrServerNameMissing = errors.New("Server name missing")
  71. ErrServerNameNotHostname = errors.New("Server name must match the format of a hostname")
  72. )