@@ -121,30 +121,36 @@ extension Error: LocalizedError {
121121 switch self {
122122 case . nullDistribution, . noSuchFilePrefix, . noSuchFile:
123123 #if canImport(Darwin)
124- return String ( localized: " Couldn’t load distribution. " , comment: " error description " )
124+ return String ( localized: " Couldn’t load distribution. " , comment: " error description " )
125125 #else
126- return " Couldn’t load distribution. "
126+ return " Couldn’t load distribution. "
127127 #endif
128128 case . badResponse, . noData, . downloadFailed:
129129 #if canImport(Darwin)
130- return String ( localized: " Couldn’t download distribution. " , comment: " error description " )
130+ return String ( localized: " Couldn’t download distribution. " , comment: " error description " )
131131 #else
132- return " Couldn’t download distribution. "
132+ return " Couldn’t download distribution. "
133133 #endif
134134 case . unknownARTCC, . unknownARTCCFrequency, . unknownFieldId,
135135 . unknownFrequencyFieldId, . invalidFrequency, . unknownFSS,
136136 . invalidRunwaySurface, . invalidPavementClassification,
137137 . invalidVGSI, . unknownNavaid, . invalidAltitudeFormat:
138138 #if canImport(Darwin)
139- return String ( localized: " Couldn’t parse distribution data. " , comment: " error description " )
139+ return String (
140+ localized: " Couldn’t parse distribution data. " ,
141+ comment: " error description "
142+ )
140143 #else
141- return " Couldn’t parse distribution data. "
144+ return " Couldn’t parse distribution data. "
142145 #endif
143146 case . notYetLoaded:
144147 #if canImport(Darwin)
145- return String ( localized: " This NASR has not been loaded yet. " , comment: " error description " )
148+ return String (
149+ localized: " This NASR has not been loaded yet. " ,
150+ comment: " error description "
151+ )
146152 #else
147- return " This NASR has not been loaded yet. "
153+ return " This NASR has not been loaded yet. "
148154 #endif
149155 }
150156 }
@@ -153,145 +159,152 @@ extension Error: LocalizedError {
153159 switch self {
154160 case . nullDistribution:
155161 #if canImport(Darwin)
156- return String (
157- localized: " Called .load() on a null distribution. " ,
158- comment: " failure reason "
159- )
162+ return String (
163+ localized: " Called .load() on a null distribution. " ,
164+ comment: " failure reason "
165+ )
160166 #else
161- return " Called .load() on a null distribution. "
167+ return " Called .load() on a null distribution. "
162168 #endif
163169 case . badResponse( let response) :
164170 #if canImport(Darwin)
165- return String (
166- localized: " Bad response: \( response. description) . " ,
167- comment: " failure reason "
168- )
171+ return String (
172+ localized: " Bad response: \( response. description) . " ,
173+ comment: " failure reason "
174+ )
169175 #else
170- return " Bad response: \( response. description) . "
176+ return " Bad response: \( response. description) . "
171177 #endif
172178 case . downloadFailed( let reason) :
173179 #if canImport(Darwin)
174- return String ( localized: " Download failed: \( reason) " , comment: " failure reason " )
180+ return String ( localized: " Download failed: \( reason) " , comment: " failure reason " )
175181 #else
176- return " Download failed: \( reason) "
182+ return " Download failed: \( reason) "
177183 #endif
178184 case . noSuchFilePrefix( let prefix) :
179185 #if canImport(Darwin)
180- return String (
181- localized: " Couldn’t find file in archive with prefix ‘ \( prefix) .’ " ,
182- comment: " failure reason "
183- )
186+ return String (
187+ localized: " Couldn’t find file in archive with prefix ‘ \( prefix) .’ " ,
188+ comment: " failure reason "
189+ )
184190 #else
185- return " Couldn’t find file in archive with prefix ‘ \( prefix) .’ "
191+ return " Couldn’t find file in archive with prefix ‘ \( prefix) .’ "
186192 #endif
187193 case . noData:
188194 #if canImport(Darwin)
189- return String ( localized: " No data was downloaded. " , comment: " failure reason " )
195+ return String ( localized: " No data was downloaded. " , comment: " failure reason " )
190196 #else
191- return " No data was downloaded. "
197+ return " No data was downloaded. "
192198 #endif
193199 case . unknownARTCC( let ID) :
194200 #if canImport(Darwin)
195- return String (
196- localized: " Referenced undefined ARTCC record with ID ‘ \( ID) ’. " ,
197- comment: " failure reason "
198- )
201+ return String (
202+ localized: " Referenced undefined ARTCC record with ID ‘ \( ID) ’. " ,
203+ comment: " failure reason "
204+ )
199205 #else
200- return " Referenced undefined ARTCC record with ID ‘ \( ID) ’. "
206+ return " Referenced undefined ARTCC record with ID ‘ \( ID) ’. "
201207 #endif
202208 case let . unknownARTCCFrequency( frequency, ARTCC) :
203209 #if canImport(Darwin)
204- return String (
205- localized: " Referenced undefined frequency ‘ \( frequency) ’ for ARTCC \( ARTCC . code) . " ,
206- comment: " failure reason "
207- )
210+ return String (
211+ localized: " Referenced undefined frequency ‘ \( frequency) ’ for ARTCC \( ARTCC . code) . " ,
212+ comment: " failure reason "
213+ )
208214 #else
209- return " Referenced undefined frequency ‘ \( frequency) ’ for ARTCC \( ARTCC . code) . "
215+ return " Referenced undefined frequency ‘ \( frequency) ’ for ARTCC \( ARTCC . code) . "
210216 #endif
211217 case let . unknownFieldId( fieldId, ARTCC) :
212218 #if canImport(Darwin)
213- return String (
214- localized: " Unknown field ID ‘ \( fieldId) ’ at ‘ \( ARTCC . code) \( ARTCC . locationName) ’. " ,
215- comment: " failure reason "
216- )
219+ return String (
220+ localized: " Unknown field ID ‘ \( fieldId) ’ at ‘ \( ARTCC . code) \( ARTCC . locationName) ’. " ,
221+ comment: " failure reason "
222+ )
217223 #else
218- return " Unknown field ID ‘ \( fieldId) ’ at ‘ \( ARTCC . code) \( ARTCC . locationName) ’. "
224+ return " Unknown field ID ‘ \( fieldId) ’ at ‘ \( ARTCC . code) \( ARTCC . locationName) ’. "
219225 #endif
220226 case let . unknownFrequencyFieldId( fieldId, frequency, ARTCC) :
221227 #if canImport(Darwin)
222- return String (
223- localized:
224- " Unknown field ID ' \( fieldId) ' for \( frequency. frequencyKHz) kHz at ' \( ARTCC . code) \( ARTCC . locationName) '. " ,
225- comment: " failure reason "
226- )
228+ return String (
229+ localized:
230+ " Unknown field ID ' \( fieldId) ' for \( frequency. frequencyKHz) kHz at ' \( ARTCC . code) \( ARTCC . locationName) '. " ,
231+ comment: " failure reason "
232+ )
227233 #else
228- return " Unknown field ID ' \( fieldId) ' for \( frequency. frequencyKHz) kHz at ' \( ARTCC . code) \( ARTCC . locationName) '. "
234+ return
235+ " Unknown field ID ' \( fieldId) ' for \( frequency. frequencyKHz) kHz at ' \( ARTCC . code) \( ARTCC . locationName) '. "
229236 #endif
230237 case . invalidFrequency( let string) :
231238 #if canImport(Darwin)
232- return String ( localized: " Invalid frequency ‘ \( string) ’. " , comment: " failure reason " )
239+ return String ( localized: " Invalid frequency ‘ \( string) ’. " , comment: " failure reason " )
233240 #else
234- return " Invalid frequency ‘ \( string) ’. "
241+ return " Invalid frequency ‘ \( string) ’. "
235242 #endif
236243 case . unknownFSS( let ID) :
237244 #if canImport(Darwin)
238- return String (
239- localized: " Continuation record references unknown FSS ‘ \( ID) ’. " ,
240- comment: " failure reason "
241- )
245+ return String (
246+ localized: " Continuation record references unknown FSS ‘ \( ID) ’. " ,
247+ comment: " failure reason "
248+ )
242249 #else
243- return " Continuation record references unknown FSS ‘ \( ID) ’. "
250+ return " Continuation record references unknown FSS ‘ \( ID) ’. "
244251 #endif
245252 case . notYetLoaded:
246253 #if canImport(Darwin)
247- return String (
248- localized: " Attempted to access NASR data before .load() was called. " ,
249- comment: " failure reason "
250- )
254+ return String (
255+ localized: " Attempted to access NASR data before .load() was called. " ,
256+ comment: " failure reason "
257+ )
251258 #else
252- return " Attempted to access NASR data before .load() was called. "
259+ return " Attempted to access NASR data before .load() was called. "
253260 #endif
254261 case . noSuchFile( let path) :
255262 #if canImport(Darwin)
256- return String (
257- localized: " No such file in distribution: \( path) . " ,
258- comment: " failure reason "
259- )
263+ return String (
264+ localized: " No such file in distribution: \( path) . " ,
265+ comment: " failure reason "
266+ )
260267 #else
261- return " No such file in distribution: \( path) . "
268+ return " No such file in distribution: \( path) . "
262269 #endif
263270 case . invalidRunwaySurface( let string) :
264271 #if canImport(Darwin)
265- return String ( localized: " Unknown runway surface ‘ \( string) ’. " , comment: " failure reason " )
272+ return String ( localized: " Unknown runway surface ‘ \( string) ’. " , comment: " failure reason " )
266273 #else
267- return " Unknown runway surface ‘ \( string) ’. "
274+ return " Unknown runway surface ‘ \( string) ’. "
268275 #endif
269276 case . invalidPavementClassification( let string) :
270277 #if canImport(Darwin)
271- return String (
272- localized: " Unknown pavement classification ‘ \( string) ’ for PCN. " ,
273- comment: " failure reason "
274- )
278+ return String (
279+ localized: " Unknown pavement classification ‘ \( string) ’ for PCN. " ,
280+ comment: " failure reason "
281+ )
275282 #else
276- return " Unknown pavement classification ‘ \( string) ’ for PCN. "
283+ return " Unknown pavement classification ‘ \( string) ’ for PCN. "
277284 #endif
278285 case . invalidVGSI( let string) :
279286 #if canImport(Darwin)
280- return String ( localized: " Unknown VGSI identifier ‘ \( string) ’. " , comment: " failure reason " )
287+ return String (
288+ localized: " Unknown VGSI identifier ‘ \( string) ’. " ,
289+ comment: " failure reason "
290+ )
281291 #else
282- return " Unknown VGSI identifier ‘ \( string) ’. "
292+ return " Unknown VGSI identifier ‘ \( string) ’. "
283293 #endif
284294 case . unknownNavaid( let string) :
285295 #if canImport(Darwin)
286- return String ( localized: " Unknown navaid ‘ \( string) ’. " , comment: " failure reason " )
296+ return String ( localized: " Unknown navaid ‘ \( string) ’. " , comment: " failure reason " )
287297 #else
288- return " Unknown navaid ‘ \( string) ’. "
298+ return " Unknown navaid ‘ \( string) ’. "
289299 #endif
290300 case . invalidAltitudeFormat( let string) :
291301 #if canImport(Darwin)
292- return String ( localized: " Invalid altitude format ‘ \( string) ’. " , comment: " failure reason " )
302+ return String (
303+ localized: " Invalid altitude format ‘ \( string) ’. " ,
304+ comment: " failure reason "
305+ )
293306 #else
294- return " Invalid altitude format ‘ \( string) ’. "
307+ return " Invalid altitude format ‘ \( string) ’. "
295308 #endif
296309 }
297310 }
@@ -300,44 +313,45 @@ extension Error: LocalizedError {
300313 switch self {
301314 case . nullDistribution:
302315 #if canImport(Darwin)
303- return String (
304- localized:
305- " Do not call .load() on a NullDistribution. Use NullDistribution for distributions that were previously loaded and serialized to disk. " ,
306- comment: " recovery suggestion "
307- )
316+ return String (
317+ localized:
318+ " Do not call .load() on a NullDistribution. Use NullDistribution for distributions that were previously loaded and serialized to disk. " ,
319+ comment: " recovery suggestion "
320+ )
308321 #else
309- return " Do not call .load() on a NullDistribution. Use NullDistribution for distributions that were previously loaded and serialized to disk. "
322+ return
323+ " Do not call .load() on a NullDistribution. Use NullDistribution for distributions that were previously loaded and serialized to disk. "
310324 #endif
311325 case . badResponse, . noData, . downloadFailed:
312326 #if canImport(Darwin)
313- return String (
314- localized: " Verify that the URL to the distribution is correct and accessible. " ,
315- comment: " recovery suggestion "
316- )
327+ return String (
328+ localized: " Verify that the URL to the distribution is correct and accessible. " ,
329+ comment: " recovery suggestion "
330+ )
317331 #else
318- return " Verify that the URL to the distribution is correct and accessible. "
332+ return " Verify that the URL to the distribution is correct and accessible. "
319333 #endif
320334 case . unknownARTCC, . unknownARTCCFrequency, . unknownFieldId,
321335 . unknownFrequencyFieldId, . invalidFrequency, . unknownFSS,
322336 . invalidRunwaySurface, . invalidPavementClassification,
323337 . invalidVGSI, . unknownNavaid, . noSuchFilePrefix, . noSuchFile,
324338 . invalidAltitudeFormat:
325339 #if canImport(Darwin)
326- return String (
327- localized: " The NASR FADDS format may have changed, requiring an update to SwiftNASR. " ,
328- comment: " recovery suggestion "
329- )
340+ return String (
341+ localized: " The NASR FADDS format may have changed, requiring an update to SwiftNASR. " ,
342+ comment: " recovery suggestion "
343+ )
330344 #else
331- return " The NASR FADDS format may have changed, requiring an update to SwiftNASR. "
345+ return " The NASR FADDS format may have changed, requiring an update to SwiftNASR. "
332346 #endif
333347 case . notYetLoaded:
334348 #if canImport(Darwin)
335- return String (
336- localized: " Call .load() before accessing NASR data. " ,
337- comment: " recovery suggestion "
338- )
349+ return String (
350+ localized: " Call .load() before accessing NASR data. " ,
351+ comment: " recovery suggestion "
352+ )
339353 #else
340- return " Call .load() before accessing NASR data. "
354+ return " Call .load() before accessing NASR data. "
341355 #endif
342356 }
343357 }
0 commit comments