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

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