Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

errors.go 5.7KB

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