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 5.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. errAccountAlreadyUnregistered = errors.New(`That account name was registered previously and can't be reused`)
  14. errAccountAlreadyVerified = errors.New(`Account is already verified`)
  15. errAccountCantDropPrimaryNick = errors.New("Can't unreserve primary nickname")
  16. errAccountCreation = errors.New("Account could not be created")
  17. errAccountDoesNotExist = errors.New("Account does not exist")
  18. errAccountInvalidCredentials = errors.New("Invalid account credentials")
  19. errAccountBadPassphrase = errors.New(`Passphrase contains forbidden characters or is otherwise invalid`)
  20. errAccountNickReservationFailed = errors.New("Could not (un)reserve nick")
  21. errAccountNotLoggedIn = errors.New("You're not logged into an account")
  22. errAccountAlreadyLoggedIn = errors.New("You're already logged into an account")
  23. errAccountTooManyNicks = errors.New("Account has too many reserved nicks")
  24. errAccountUnverified = errors.New(`Account is not yet verified`)
  25. errAccountVerificationFailed = errors.New("Account verification failed")
  26. errAccountVerificationInvalidCode = errors.New("Invalid account verification code")
  27. errAccountUpdateFailed = errors.New(`Error while updating your account information`)
  28. errAccountMustHoldNick = errors.New(`You must hold that nickname in order to register it`)
  29. errAuthzidAuthcidMismatch = errors.New(`authcid and authzid must be the same`)
  30. errCallbackFailed = errors.New("Account verification could not be sent")
  31. errCertfpAlreadyExists = errors.New(`An account already exists for your certificate fingerprint`)
  32. errChannelNotOwnedByAccount = errors.New("Channel not owned by the specified account")
  33. errChannelTransferNotOffered = errors.New(`You weren't offered ownership of that channel`)
  34. errChannelAlreadyRegistered = errors.New("Channel is already registered")
  35. errChannelNotRegistered = errors.New("Channel is not registered")
  36. errChannelNameInUse = errors.New(`Channel name in use`)
  37. errInvalidChannelName = errors.New(`Invalid channel name`)
  38. errMonitorLimitExceeded = errors.New("Monitor limit exceeded")
  39. errNickMissing = errors.New("nick missing")
  40. errNicknameInvalid = errors.New("invalid nickname")
  41. errNicknameInUse = errors.New("nickname in use")
  42. errNicknameReserved = errors.New("nickname is reserved")
  43. errNickAccountMismatch = errors.New(`Your nickname must match your account name; try logging out and logging back in with SASL`)
  44. errNoExistingBan = errors.New("Ban does not exist")
  45. errNoSuchChannel = errors.New(`No such channel`)
  46. errChannelPurged = errors.New(`This channel was purged by the server operators and cannot be used`)
  47. errConfusableIdentifier = errors.New("This identifier is confusable with one already in use")
  48. errInsufficientPrivs = errors.New("Insufficient privileges")
  49. errInvalidUsername = errors.New("Invalid username")
  50. errFeatureDisabled = errors.New(`That feature is disabled`)
  51. errBanned = errors.New("IP or nickmask banned")
  52. errInvalidParams = utils.ErrInvalidParams
  53. errNoVhost = errors.New(`You do not have an approved vhost`)
  54. errVhostsForbidden = errors.New(`An administrator has denied you the ability to use vhosts`)
  55. errLimitExceeded = errors.New("Limit exceeded")
  56. errNoop = errors.New("Action was a no-op")
  57. errCASFailed = errors.New("Compare-and-swap update of database value failed")
  58. errEmptyCredentials = errors.New("No more credentials are approved")
  59. errCredsExternallyManaged = errors.New("Credentials are externally managed and cannot be changed here")
  60. )
  61. // Socket Errors
  62. var (
  63. errNoPeerCerts = errors.New("Client did not provide a certificate")
  64. errNotTLS = errors.New("Not a TLS connection")
  65. errReadQ = errors.New("ReadQ Exceeded")
  66. )
  67. // String Errors
  68. var (
  69. errCouldNotStabilize = errors.New("Could not stabilize string while casefolding")
  70. errStringIsEmpty = errors.New("String is empty")
  71. errInvalidCharacter = errors.New("Invalid character")
  72. )
  73. // Config Errors
  74. var (
  75. ErrDatastorePathMissing = errors.New("Datastore path missing")
  76. ErrInvalidCertKeyPair = errors.New("tls cert+key: invalid pair")
  77. ErrLimitsAreInsane = errors.New("Limits aren't setup properly, check them and make them sane")
  78. ErrLineLengthsTooSmall = errors.New("Line lengths must be 512 or greater (check the linelen section under server->limits)")
  79. ErrLoggerExcludeEmpty = errors.New("Encountered logging type '-' with no type to exclude")
  80. ErrLoggerFilenameMissing = errors.New("Logging configuration specifies 'file' method but 'filename' is empty")
  81. ErrLoggerHasNoTypes = errors.New("Logger has no types to log")
  82. ErrNetworkNameMissing = errors.New("Network name missing")
  83. ErrNoFingerprintOrPassword = errors.New("Fingerprint or password needs to be specified")
  84. ErrNoListenersDefined = errors.New("Server listening addresses missing")
  85. ErrOperClassDependencies = errors.New("OperClasses contains a looping dependency, or a class extends from a class that doesn't exist")
  86. ErrServerNameMissing = errors.New("Server name missing")
  87. ErrServerNameNotHostname = errors.New("Server name must match the format of a hostname")
  88. )