/** * @author songxiwen * @date 2020/08/12 14:37 */ import { TowifyError } from '../../base/error'; export class ServerError { static code = { DatabaseException: new TowifyError('Database exception', 10001), AuthException: new TowifyError('Auth exception', 20001), PhoneNotExists: new TowifyError('Phone not exists', 20002), AuthTokenNotExists: new TowifyError('Token not exists', 20003), ValidationFailed: new TowifyError('Validation failed', 30001), SMSCodeNotMatch: new TowifyError('SMS code not match', 30002), SMSCodeExpired: new TowifyError('SMS code expired', 30003), SMSCodeRemoteWrong: new TowifyError('SMS code remote wrong', 30004), SMSCodeRequestFrequently: new TowifyError( 'SMS code request frequently', 30005 ), UserNotExists: new TowifyError('User not exists', 30006), UserExists: new TowifyError('User exists', 30007), WrongPassword: new TowifyError('Wrong password', 30008), PasswordNotExists: new TowifyError('Password dose not exists', 30009), ProjectPermissionDenied: new TowifyError( 'Project permission denied', 30010 ), ProjectCollaboratorNotExists: new TowifyError( 'Project collaborator not exists', 30011 ), FileNotExists: new TowifyError('File not exists', 40001), AdminNotExists: new TowifyError('Admin not exists', 50001), EmailCodeExpired: new TowifyError('Email code expired', 30012), WrongEmailCode: new TowifyError('Email code error', 30013), EmailSendFailed: new TowifyError('Email send failed', 30014), FileUploadFailed: new TowifyError('File upload failed', 30015), EmailInvalid: new TowifyError('Email invalid', 30016), ProjectDatabaseInvalidQuery: new TowifyError( 'Project database invalid query', 60001 ), ColumnNameExists: new TowifyError('Column name exists', 60002), TableNameExists: new TowifyError('Table name exists', 60003) }; }