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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. errLimitExceeded = errors.New("Limit exceeded")
  51. errNoop = errors.New("Action was a no-op")
  52. errCASFailed = errors.New("Compare-and-swap update of database value failed")
  53. errEmptyCredentials = errors.New("No more credentials are approved")
  54. )
  55. // Socket Errors
  56. var (
  57. errNoPeerCerts = errors.New("Client did not provide a certificate")
  58. errNotTLS = errors.New("Not a TLS connection")
  59. errReadQ = errors.New("ReadQ Exceeded")
  60. )
  61. // String Errors
  62. var (
  63. errCouldNotStabilize = errors.New("Could not stabilize string while casefolding")
  64. errStringIsEmpty = errors.New("String is empty")
  65. errInvalidCharacter = errors.New("Invalid character")
  66. )
  67. // Config Errors
  68. var (
  69. ErrDatastorePathMissing = errors.New("Datastore path missing")
  70. ErrInvalidCertKeyPair = errors.New("tls cert+key: invalid pair")
  71. ErrLimitsAreInsane = errors.New("Limits aren't setup properly, check them and make them sane")
  72. ErrLineLengthsTooSmall = errors.New("Line lengths must be 512 or greater (check the linelen section under server->limits)")
  73. ErrLoggerExcludeEmpty = errors.New("Encountered logging type '-' with no type to exclude")
  74. ErrLoggerFilenameMissing = errors.New("Logging configuration specifies 'file' method but 'filename' is empty")
  75. ErrLoggerHasNoTypes = errors.New("Logger has no types to log")
  76. ErrNetworkNameMissing = errors.New("Network name missing")
  77. ErrNoFingerprintOrPassword = errors.New("Fingerprint or password needs to be specified")
  78. ErrNoListenersDefined = errors.New("Server listening addresses missing")
  79. ErrOperClassDependencies = errors.New("OperClasses contains a looping dependency, or a class extends from a class that doesn't exist")
  80. ErrServerNameMissing = errors.New("Server name missing")
  81. ErrServerNameNotHostname = errors.New("Server name must match the format of a hostname")
  82. )