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.4KB

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