@@ -111,18 +111,18 @@ enum ErrorClassifier {
111111 let recovery : String
112112
113113 if msg. lowercased ( ) . contains ( " authentication " ) || msg. lowercased ( ) . contains ( " key " ) {
114- recovery = " Check your SSH username, password, or private key. "
114+ recovery = String ( localized : " Check your SSH username, password, or private key. " )
115115 } else if msg. lowercased ( ) . contains ( " handshake " ) {
116- recovery = " The SSH server may be unreachable or running a different protocol. "
116+ recovery = String ( localized : " The SSH server may be unreachable or running a different protocol. " )
117117 } else if msg. lowercased ( ) . contains ( " channel " ) {
118- recovery = " The SSH tunnel connected but could not forward to the database port. "
118+ recovery = String ( localized : " The SSH tunnel connected but could not forward to the database port. " )
119119 } else {
120- recovery = " Check your SSH host, port, and credentials. "
120+ recovery = String ( localized : " Check your SSH host, port, and credentials. " )
121121 }
122122
123123 return AppError (
124124 category: . ssh,
125- title: " SSH Tunnel Failed " ,
125+ title: String ( localized : " SSH Tunnel Failed " ) ,
126126 message: msg,
127127 recovery: recovery,
128128 underlying: error
@@ -133,9 +133,9 @@ enum ErrorClassifier {
133133 let dbName = context. databaseType? . rawValue ?? " Database "
134134 return AppError (
135135 category: . auth,
136- title: " Authentication Failed " ,
136+ title: String ( localized : " Authentication Failed " ) ,
137137 message: error. localizedDescription,
138- recovery: " Check your \( dbName ) username and password. " ,
138+ recovery: String ( format : String ( localized : " Check your %@ username and password. " ) , dbName ) ,
139139 underlying: error
140140 )
141141 }
@@ -145,16 +145,16 @@ enum ErrorClassifier {
145145 let recovery : String
146146
147147 if msg. lowercased ( ) . contains ( " timeout " ) || msg. lowercased ( ) . contains ( " timed out " ) {
148- recovery = " The server is not responding. Check your network connection and that the server is running. "
148+ recovery = String ( localized : " The server is not responding. Check the host and port. " )
149149 } else if msg. lowercased ( ) . contains ( " refused " ) {
150- recovery = " Connection refused. Verify the host address and port number. "
150+ recovery = String ( localized : " Connection refused. The server may not be running or the port is incorrect. " )
151151 } else {
152- recovery = " Check your network connection and server availability. "
152+ recovery = String ( localized : " Check your network connection and server availability. " )
153153 }
154154
155155 return AppError (
156156 category: . network,
157- title: " Connection Failed " ,
157+ title: String ( localized : " Connection Failed " ) ,
158158 message: msg,
159159 recovery: recovery,
160160 underlying: error
@@ -166,18 +166,18 @@ enum ErrorClassifier {
166166 let recovery : String
167167
168168 if msg. lowercased ( ) . contains ( " syntax " ) {
169- recovery = " Check your SQL syntax. "
169+ recovery = String ( localized : " Check your SQL syntax. " )
170170 } else if msg. lowercased ( ) . contains ( " constraint " ) || msg. lowercased ( ) . contains ( " duplicate " ) {
171- recovery = " The operation violates a database constraint. Check for duplicate or missing required values. "
171+ recovery = String ( localized : " The operation violates a database constraint. " )
172172 } else if msg. lowercased ( ) . contains ( " no such table " ) || msg. lowercased ( ) . contains ( " does not exist " ) {
173- recovery = " The table or column does not exist. It may have been renamed or deleted. "
173+ recovery = String ( localized : " The table or column does not exist. " )
174174 } else {
175- recovery = " Check your query and try again. "
175+ recovery = String ( localized : " Check your query and try again. " )
176176 }
177177
178178 return AppError (
179179 category: . query,
180- title: " Query Error " ,
180+ title: String ( localized : " Query Error " ) ,
181181 message: msg,
182182 recovery: recovery,
183183 underlying: error
@@ -187,9 +187,9 @@ enum ErrorClassifier {
187187 private static func config( _ error: Error , context: ErrorContext ) -> AppError {
188188 return AppError (
189189 category: . config,
190- title: " Configuration Error " ,
190+ title: String ( localized : " Configuration Error " ) ,
191191 message: error. localizedDescription,
192- recovery: " Check your connection settings. " ,
192+ recovery: String ( localized : " Check your connection settings. " ) ,
193193 underlying: error
194194 )
195195 }
0 commit comments