ICU-738/Refactor internal/db to domain errors (#815)

* Refactor internal/db to domain errors
This commit is contained in:
Louis Ruch authored and GitHub committed 2020-12-21 10:07:34 -08:00
1 parent b5d84495a3
commit bfbb179741
82 files changed
+742 -640

No files matched your search

+18 -1
View File
@@ -27,6 +27,21 @@ const (
InvalidFieldMask Code = 103 // InvalidFieldMask represents an invalid field mast for an operation
EmptyFieldMask Code = 104 // EmptyFieldMask represents an empty field mask for an operation
// PasswordTooShort results from attempting to set a password which is to short.
PasswordTooShort Code = 200
// PasswordUnsupportedConfiguration results from attempting to perform an
// operation that sets a password configuration to an unsupported type.
PasswordUnsupportedConfiguration Code = 201
// PasswordInvalidConfiguration results from attempting to perform an
// operation that sets a valid password configuration with invalid settings.
PasswordInvalidConfiguration Code = 202
// PasswordsEqual is returned from ChangePassword when the old and
// new passwords are equal.
PasswordsEqual Code = 203
// DB errors are reserved Codes from 1000-1999
CheckConstraint Code = 1000 // CheckConstraint represents a check constraint error
NotNull Code = 1001 // NotNull represents a value must not be null error
@@ -35,5 +50,7 @@ const (
MissingTable Code = 1004 // Missing table represents an undefined table error
RecordNotFound Code = 1100 // RecordNotFound represents that a record/row was not found matching the criteria
MultipleRecords Code = 1101 // MultipleRecords represents that multiple records/rows were found matching the criteria
ColumnNotFound Code = 1102 // ColumnNotFound represent that a column was not found in the underlying db
MaxRetries Code = 1103 // MaxRetries represent that a db Tx hit max retires allowed
Exception Code = 1104 // Exception represent that an underlying db exception was raised
)