X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mailshears.git;a=blobdiff_plain;f=lib%2Fcommon%2Ferrors.rb;h=7e2bd505ed9a5ffb888fa7cb2cf7f048dc7d3a5d;hp=7a2fbba565c035c7584972c3de211b0acf4ce4d2;hb=aebdf12adce2766e2957f88916fcae6374d4eb4b;hpb=f819b178c5c1cb8adda0182c610e5c52fad8bea7 diff --git a/lib/common/errors.rb b/lib/common/errors.rb index 7a2fbba..7e2bd50 100644 --- a/lib/common/errors.rb +++ b/lib/common/errors.rb @@ -1,27 +1,15 @@ -# A generalization of PGError, and whatever MySQL and the other -# databases might eventually use. -class DatabaseError < StandardError -end +# An error indicating that a username is syntactically invalid. +class InvalidUserError < StandardError; end +# An error indicating that a domain is syntactically invalid. +class InvalidDomainError < StandardError; end -# Username is syntactically invalid. -class InvalidUserError < StandardError -end +# An error indicating that a user does not exist. +class NonexistentUserError < StandardError; end -# Domain is syntactically invalid. -class InvalidDomainError < StandardError -end +# An error indicating that a domain does not exist. +class NonexistentDomainError < StandardError; end - -# Used to indicate that an user does not exist. -class NonexistentUserError < StandardError -end - -# Used to indicate that a domain does not exist. -class NonexistentDomainError < StandardError -end - - -# When you try to rename a user on top of one that already exists. -class UserAlreadyExistsError < StandardError -end +# An error indicating that some user already exists. For example, if +# one tries to rename a user and the destination user already exists. +class UserAlreadyExistsError < StandardError; end