-
Notifications
You must be signed in to change notification settings - Fork 1
/
errors.go
493 lines (487 loc) · 21.6 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
package wu
type WUError int64
const (
WU_S_SERVICE_STOP WUError = 0x00240001
WU_S_SELFUPDATE WUError = 0x00240002
WU_S_UPDATE_ERROR WUError = 0x00240003
WU_S_MARKED_FOR_DISCONNECT WUError = 0x00240004
WU_S_REBOOT_REQUIRED WUError = 0x00240005
WU_S_ALREADY_INSTALLED WUError = 0x00240006
WU_S_ALREADY_UNINSTALLED WUError = 0x00240007
WU_S_ALREADY_DOWNLOADED WUError = 0x00240008
WU_S_UH_INSTALLSTILLPENDING WUError = 0x00242015
WU_E_NO_SERVICE WUError = 0x80240001
WU_E_MAX_CAPACITY_REACHED WUError = 0x80240002
WU_E_UNKNOWN_ID WUError = 0x80240003
WU_E_NOT_INITIALIZED WUError = 0x80240004
WU_E_RANGEOVERLAP WUError = 0x80240005
WU_E_TOOMANYRANGES WUError = 0x80240006
WU_E_INVALIDINDEX WUError = 0x80240007
WU_E_ITEMNOTFOUND WUError = 0x80240008
WU_E_OPERATIONINPROGRESS WUError = 0x80240009
WU_E_COULDNOTCANCEL WUError = 0x8024000A
WU_E_CALL_CANCELLED WUError = 0x8024000B
WU_E_NOOP WUError = 0x8024000C
WU_E_XML_MISSINGDATA WUError = 0x8024000D
WU_E_XML_INVALID WUError = 0x8024000E
WU_E_CYCLE_DETECTED WUError = 0x8024000F
WU_E_TOO_DEEP_RELATION WUError = 0x80240010
WU_E_INVALID_RELATIONSHIP WUError = 0x80240011
WU_E_REG_VALUE_INVALID WUError = 0x80240012
WU_E_DUPLICATE_ITEM WUError = 0x80240013
WU_E_INVALID_INSTALL_REQUESTED WUError = 0x80240014
WU_E_INSTALL_NOT_ALLOWED WUError = 0x80240016
WU_E_NOT_APPLICABLE WUError = 0x80240017
WU_E_NO_USERTOKEN WUError = 0x80240018
WU_E_EXCLUSIVE_INSTALL_CONFLICT WUError = 0x80240019
WU_E_POLICY_NOT_SET WUError = 0x8024001A
WU_E_SELFUPDATE_IN_PROGRESS WUError = 0x8024001B
WU_E_INVALID_UPDATE WUError = 0x8024001D
WU_E_SERVICE_STOP WUError = 0x8024001E
WU_E_NO_CONNECTION WUError = 0x8024001F
WU_E_NO_INTERACTIVE_USER WUError = 0x80240020
WU_E_TIME_OUT WUError = 0x80240021
WU_E_ALL_UPDATES_FAILED WUError = 0x80240022
WU_E_EULAS_DECLINED WUError = 0x80240023
WU_E_NO_UPDATE WUError = 0x80240024
WU_E_USER_ACCESS_DISABLED WUError = 0x80240025
WU_E_INVALID_UPDATE_TYPE WUError = 0x80240026
WU_E_URL_TOO_LONG WUError = 0x80240027
WU_E_UNINSTALL_NOT_ALLOWED WUError = 0x80240028
WU_E_INVALID_PRODUCT_LICENSE WUError = 0x80240029
WU_E_MISSING_HANDLER WUError = 0x8024002A
WU_E_LEGACYSERVER WUError = 0x8024002B
WU_E_BIN_SOURCE_ABSENT WUError = 0x8024002C
WU_E_SOURCE_ABSENT WUError = 0x8024002D
WU_E_WU_DISABLED WUError = 0x8024002E
WU_E_CALL_CANCELLED_BY_POLICY WUError = 0x8024002F
WU_E_INVALID_PROXY_SERVER WUError = 0x80240030
WU_E_INVALID_FILE WUError = 0x80240031
WU_E_INVALID_CRITERIA WUError = 0x80240032
WU_E_EULA_UNAVAILABLE WUError = 0x80240033
WU_E_DOWNLOAD_FAILED WUError = 0x80240034
WU_E_UPDATE_NOT_PROCESSED WUError = 0x80240035
WU_E_INVALID_OPERATION WUError = 0x80240036
WU_E_NOT_SUPPORTED WUError = 0x80240037
WU_E_TOO_MANY_RESYNC WUError = 0x80240039
WU_E_NO_SERVER_CORE_SUPPORT WUError = 0x80240040
WU_E_SYSPREP_IN_PROGRESS WUError = 0x80240041
WU_E_UNKNOWN_SERVICE WUError = 0x80240042
WU_E_NO_UI_SUPPORT WUError = 0x80240043
WU_E_PER_MACHINE_UPDATE_ACCESS_DENIED WUError = 0x80240044
WU_E_UNSUPPORTED_SEARCHSCOPE WUError = 0x80240045
WU_E_BAD_FILE_URL WUError = 0x80240046
WU_E_NOTSUPPORTED WUError = 0x80240047
WU_E_INVALID_NOTIFICATION_INFO WUError = 0x80240048
WU_E_OUTOFRANGE WUError = 0x80240049
WU_E_SETUP_IN_PROGRESS WUError = 0x8024004A
WU_E_UNEXPECTED WUError = 0x80240FFF
WU_E_WINHTTP_INVALID_FILE WUError = 0x80240038
WU_E_PT_HTTP_STATUS_BAD_REQUEST WUError = 0x80244016
WU_E_PT_HTTP_STATUS_DENIED WUError = 0x80244017
WU_E_PT_HTTP_STATUS_FORBIDDEN WUError = 0x80244018
WU_E_PT_HTTP_STATUS_NOT_FOUND WUError = 0x80244019
WU_E_PT_HTTP_STATUS_BAD_METHOD WUError = 0x8024401A
WU_E_PT_HTTP_STATUS_PROXY_AUTH_REQ WUError = 0x8024401B
WU_E_PT_HTTP_STATUS_REQUEST_TIMEOUT WUError = 0x8024401C
WU_E_PT_HTTP_STATUS_CONFLICT WUError = 0x8024401D
WU_E_PT_HTTP_STATUS_GONE WUError = 0x8024401E
WU_E_PT_HTTP_STATUS_SERVER_ERROR WUError = 0x8024401F
WU_E_PT_HTTP_STATUS_NOT_SUPPORTED WUError = 0x80244020
WU_E_PT_HTTP_STATUS_BAD_GATEWAY WUError = 0x80244021
WU_E_PT_HTTP_STATUS_SERVICE_UNAVAIL WUError = 0x80244022
WU_E_PT_HTTP_STATUS_GATEWAY_TIMEOUT WUError = 0x80244023
WU_E_PT_HTTP_STATUS_VERSION_NOT_SUP WUError = 0x80244024
WU_E_PT_HTTP_STATUS_NOT_MAPPED WUError = 0x8024402B
WU_E_PT_WINHTTP_NAME_NOT_RESOLVED WUError = 0x8024402C
)
func ErrorDesc(errCode WUError) string {
switch errCode {
case WU_S_SERVICE_STOP:
return `WUA was stopped successfully.`
case WU_S_SELFUPDATE:
return `WUA updated itself.`
case WU_S_UPDATE_ERROR:
return `The operation completed successfully but errors occurred applying the updates.`
case WU_S_MARKED_FOR_DISCONNECT:
return `A callback was marked to be disconnected later because the request to disconnect the operation came while a callback was executing.`
case WU_S_REBOOT_REQUIRED:
return `The system must be restarted to complete installation of the update.`
case WU_S_ALREADY_INSTALLED:
return `The update to be installed is already installed on the system.`
case WU_S_ALREADY_UNINSTALLED:
return `The update to be removed is not installed on the system.`
case WU_S_ALREADY_DOWNLOADED:
return `The update to be downloaded has already been downloaded.`
case WU_S_UH_INSTALLSTILLPENDING:
return `The installation operation for the update is still in progress.`
case WU_E_NO_SERVICE:
return `WUA was unable to provide the service.`
case WU_E_MAX_CAPACITY_REACHED:
return `The maximum capacity of the service was exceeded.`
case WU_E_UNKNOWN_ID:
return `WUA cannot find an ID.`
case WU_E_NOT_INITIALIZED:
return `The object could not be initialized.`
case WU_E_RANGEOVERLAP:
return `The update handler requested a byte range overlapping a previously requested range.`
case WU_E_TOOMANYRANGES:
return `The requested number of byte ranges exceeds the maximum number (231 - 1).`
case WU_E_INVALIDINDEX:
return `The index to a collection was invalid.`
case WU_E_ITEMNOTFOUND:
return `The key for the item queried could not be found.`
case WU_E_OPERATIONINPROGRESS:
return `Another conflicting operation was in progress. Some operations such as installation cannot be performed twice simultaneously.`
case WU_E_COULDNOTCANCEL:
return `Cancellation of the operation was not allowed.`
case WU_E_CALL_CANCELLED:
return `Operation was cancelled.`
case WU_E_NOOP:
return `No operation was required.`
case WU_E_XML_MISSINGDATA:
return `WUA could not find required information in the update's XML data.`
case WU_E_XML_INVALID:
return `WUA found invalid information in the update's XML data.`
case WU_E_CYCLE_DETECTED:
return `Circular update relationships were detected in the metadata.`
case WU_E_TOO_DEEP_RELATION:
return `Update relationships too deep to evaluate were evaluated.`
case WU_E_INVALID_RELATIONSHIP:
return `An invalid update relationship was detected.`
case WU_E_REG_VALUE_INVALID:
return `An invalid registry value was read.`
case WU_E_DUPLICATE_ITEM:
return `Operation tried to add a duplicate item to a list.`
case WU_E_INVALID_INSTALL_REQUESTED:
return `Updates that are requested for install are not installable by the caller.`
case WU_E_INSTALL_NOT_ALLOWED:
return `Operation tried to install while another installation was in progress or the system was pending a mandatory restart.`
case WU_E_NOT_APPLICABLE:
return `Operation was not performed because there are no applicable updates.`
case WU_E_NO_USERTOKEN:
return `Operation failed because a required user token is missing.`
case WU_E_EXCLUSIVE_INSTALL_CONFLICT:
return `An exclusive update can't be installed with other updates at the same time.`
case WU_E_POLICY_NOT_SET:
return `A policy value was not set.`
case WU_E_SELFUPDATE_IN_PROGRESS:
return `The operation could not be performed because the Windows Update Agent is self-updating.`
case WU_E_INVALID_UPDATE:
return `An update contains invalid metadata.`
case WU_E_SERVICE_STOP:
return `Operation did not complete because the service or system was being shut down.`
case WU_E_NO_CONNECTION:
return `Operation did not complete because the network connection was unavailable.`
case WU_E_NO_INTERACTIVE_USER:
return `Operation did not complete because there is no logged-on interactive user.`
case WU_E_TIME_OUT:
return `Operation did not complete because it timed out.`
case WU_E_ALL_UPDATES_FAILED:
return `Operation failed for all the updates.`
case WU_E_EULAS_DECLINED:
return `The license terms for all updates were declined.`
case WU_E_NO_UPDATE:
return `There are no updates.`
case WU_E_USER_ACCESS_DISABLED:
return `Group Policy settings prevented access to Windows Update.`
case WU_E_INVALID_UPDATE_TYPE:
return `The type of update is invalid.`
case WU_E_URL_TOO_LONG:
return `The URL exceeded the maximum length.`
case WU_E_UNINSTALL_NOT_ALLOWED:
return `The update could not be uninstalled because the request did not originate from a Windows Server Update Services (WSUS) server.`
case WU_E_INVALID_PRODUCT_LICENSE:
return `Search may have missed some updates before there is an unlicensed application on the system.`
case WU_E_MISSING_HANDLER:
return `A component required to detect applicable updates was missing.`
case WU_E_LEGACYSERVER:
return `An operation did not complete because it requires a newer version of server.`
case WU_E_BIN_SOURCE_ABSENT:
return `A delta-compressed update could not be installed because it required the source.`
case WU_E_SOURCE_ABSENT:
return `A full-file update could not be installed because it required the source.`
case WU_E_WU_DISABLED:
return `Access to an unmanaged server is not allowed.`
case WU_E_CALL_CANCELLED_BY_POLICY:
return `Operation did not complete because the DisableWindowsUpdateAccess policy was set in the registry.`
case WU_E_INVALID_PROXY_SERVER:
return `The format of the proxy list was invalid.`
case WU_E_INVALID_FILE:
return `The file is in the wrong format.`
case WU_E_INVALID_CRITERIA:
return `The search criteria string was invalid.`
case WU_E_EULA_UNAVAILABLE:
return `License terms could not be downloaded.`
case WU_E_DOWNLOAD_FAILED:
return `Update failed to download.`
case WU_E_UPDATE_NOT_PROCESSED:
return `The update was not processed.`
case WU_E_INVALID_OPERATION:
return `The object's current state did not allow the operation.`
case WU_E_NOT_SUPPORTED:
return `The functionality for the operation is not supported.`
case WU_E_TOO_MANY_RESYNC:
return `Agent is asked by server to resync too many times.`
case WU_E_NO_SERVER_CORE_SUPPORT:
return `The WUA API method does not run on the server core installation.`
case WU_E_SYSPREP_IN_PROGRESS:
return `Service is not available while sysprep is running.`
case WU_E_UNKNOWN_SERVICE:
return `The update service is no longer registered with automatic updates.`
case WU_E_NO_UI_SUPPORT:
return `No support for the WUA user interface.`
case WU_E_PER_MACHINE_UPDATE_ACCESS_DENIED:
return `Only administrators can perform this operation on per-computer updates.`
case WU_E_UNSUPPORTED_SEARCHSCOPE:
return `A search was attempted with a scope that is not currently supported for this type of search.`
case WU_E_BAD_FILE_URL:
return `The URL does not point to a file.`
case WU_E_NOTSUPPORTED:
return `The operation requested is not supported.`
case WU_E_INVALID_NOTIFICATION_INFO:
return `The featured update notification info returned by the server is invalid.`
case WU_E_OUTOFRANGE:
return `The data is out of range.`
case WU_E_SETUP_IN_PROGRESS:
return `WUA operations are not available while operating system setup is running.`
case WU_E_UNEXPECTED:
return `An operation failed due to reasons not covered by another error code.`
case WU_E_WINHTTP_INVALID_FILE:
return `The downloaded file has an unexpected content type.`
case WU_E_PT_HTTP_STATUS_BAD_REQUEST:
return `Same as HTTP status 400 – The server could not process the request due to invalid syntax.`
case WU_E_PT_HTTP_STATUS_DENIED:
return `Same as HTTP status 401 – The requested resource requires user authentication.`
case WU_E_PT_HTTP_STATUS_FORBIDDEN:
return `Same as HTTP status 403 – Server understood the request, but declines to fulfill it.`
case WU_E_PT_HTTP_STATUS_NOT_FOUND:
return `Same as HTTP status 404 – The server cannot find the requested URI (Uniform Resource Identifier).`
case WU_E_PT_HTTP_STATUS_BAD_METHOD:
return `Same as HTTP status 405 – The HTTP method is not allowed.`
case WU_E_PT_HTTP_STATUS_PROXY_AUTH_REQ:
return `Same as HTTP status 407 – Proxy authentication is required.`
case WU_E_PT_HTTP_STATUS_REQUEST_TIMEOUT:
return `Same as HTTP status 408 – The server timed out waiting for the request.`
case WU_E_PT_HTTP_STATUS_CONFLICT:
return `Same as HTTP status 409 – The request was not completed due to a conflict with the current state of the resource.`
case WU_E_PT_HTTP_STATUS_GONE:
return `Same as HTTP status 410 – Requested resource is no longer available at the server.`
case WU_E_PT_HTTP_STATUS_SERVER_ERROR:
return `Same as HTTP status 500 – An error internal to the server prevented fulfilling the request.`
case WU_E_PT_HTTP_STATUS_NOT_SUPPORTED:
return `Same as HTTP status 501 – Server does not support the functionality required to fulfill the request.`
case WU_E_PT_HTTP_STATUS_BAD_GATEWAY:
return `Same as HTTP status 502 – The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the request.`
case WU_E_PT_HTTP_STATUS_SERVICE_UNAVAIL:
return `Same as HTTP status 503 – The service is temporarily overloaded.`
case WU_E_PT_HTTP_STATUS_GATEWAY_TIMEOUT:
return `Same as HTTP status 504 – The request was timed out waiting for a gateway.`
case WU_E_PT_HTTP_STATUS_VERSION_NOT_SUP:
return `Same as HTTP status 505 – The server does not support the HTTP protocol version used for the request.`
case WU_E_PT_HTTP_STATUS_NOT_MAPPED:
return `The request could not be completed and the reason did not correspond to any of the WU_E_PT_HTTP_* error codes.`
case WU_E_PT_WINHTTP_NAME_NOT_RESOLVED:
return `Same as ERROR_WINHTTP_NAME_NOT_RESOLVED - The proxy server or target server name cannot be resolved.`
default:
return `Unknown error.`
}
}
func ErrorName(errCode WUError) string {
switch errCode {
case WU_S_SERVICE_STOP:
return `WU_S_SERVICE_STOP`
case WU_S_SELFUPDATE:
return `WU_S_SELFUPDATE`
case WU_S_UPDATE_ERROR:
return `WU_S_UPDATE_ERROR`
case WU_S_MARKED_FOR_DISCONNECT:
return `WU_S_MARKED_FOR_DISCONNECT`
case WU_S_REBOOT_REQUIRED:
return `WU_S_REBOOT_REQUIRED`
case WU_S_ALREADY_INSTALLED:
return `WU_S_ALREADY_INSTALLED`
case WU_S_ALREADY_UNINSTALLED:
return `WU_S_ALREADY_UNINSTALLED`
case WU_S_ALREADY_DOWNLOADED:
return `WU_S_ALREADY_DOWNLOADED`
case WU_S_UH_INSTALLSTILLPENDING:
return `WU_S_UH_INSTALLSTILLPENDING`
case WU_E_NO_SERVICE:
return `WU_E_NO_SERVICE`
case WU_E_MAX_CAPACITY_REACHED:
return `WU_E_MAX_CAPACITY_REACHED`
case WU_E_UNKNOWN_ID:
return `WU_E_UNKNOWN_ID`
case WU_E_NOT_INITIALIZED:
return `WU_E_NOT_INITIALIZED`
case WU_E_RANGEOVERLAP:
return `WU_E_RANGEOVERLAP`
case WU_E_TOOMANYRANGES:
return `WU_E_TOOMANYRANGES`
case WU_E_INVALIDINDEX:
return `WU_E_INVALIDINDEX`
case WU_E_ITEMNOTFOUND:
return `WU_E_ITEMNOTFOUND`
case WU_E_OPERATIONINPROGRESS:
return `WU_E_OPERATIONINPROGRESS`
case WU_E_COULDNOTCANCEL:
return `WU_E_COULDNOTCANCEL`
case WU_E_CALL_CANCELLED:
return `WU_E_CALL_CANCELLED`
case WU_E_NOOP:
return `WU_E_NOOP`
case WU_E_XML_MISSINGDATA:
return `WU_E_XML_MISSINGDATA`
case WU_E_XML_INVALID:
return `WU_E_XML_INVALID`
case WU_E_CYCLE_DETECTED:
return `WU_E_CYCLE_DETECTED`
case WU_E_TOO_DEEP_RELATION:
return `WU_E_TOO_DEEP_RELATION`
case WU_E_INVALID_RELATIONSHIP:
return `WU_E_INVALID_RELATIONSHIP`
case WU_E_REG_VALUE_INVALID:
return `WU_E_REG_VALUE_INVALID`
case WU_E_DUPLICATE_ITEM:
return `WU_E_DUPLICATE_ITEM`
case WU_E_INVALID_INSTALL_REQUESTED:
return `WU_E_INVALID_INSTALL_REQUESTED`
case WU_E_INSTALL_NOT_ALLOWED:
return `WU_E_INSTALL_NOT_ALLOWED`
case WU_E_NOT_APPLICABLE:
return `WU_E_NOT_APPLICABLE`
case WU_E_NO_USERTOKEN:
return `WU_E_NO_USERTOKEN`
case WU_E_EXCLUSIVE_INSTALL_CONFLICT:
return `WU_E_EXCLUSIVE_INSTALL_CONFLICT`
case WU_E_POLICY_NOT_SET:
return `WU_E_POLICY_NOT_SET`
case WU_E_SELFUPDATE_IN_PROGRESS:
return `WU_E_SELFUPDATE_IN_PROGRESS`
case WU_E_INVALID_UPDATE:
return `WU_E_INVALID_UPDATE`
case WU_E_SERVICE_STOP:
return `WU_E_SERVICE_STOP`
case WU_E_NO_CONNECTION:
return `WU_E_NO_CONNECTION`
case WU_E_NO_INTERACTIVE_USER:
return `WU_E_NO_INTERACTIVE_USER`
case WU_E_TIME_OUT:
return `WU_E_TIME_OUT`
case WU_E_ALL_UPDATES_FAILED:
return `WU_E_ALL_UPDATES_FAILED`
case WU_E_EULAS_DECLINED:
return `WU_E_EULAS_DECLINED`
case WU_E_NO_UPDATE:
return `WU_E_NO_UPDATE`
case WU_E_USER_ACCESS_DISABLED:
return `WU_E_USER_ACCESS_DISABLED`
case WU_E_INVALID_UPDATE_TYPE:
return `WU_E_INVALID_UPDATE_TYPE`
case WU_E_URL_TOO_LONG:
return `WU_E_URL_TOO_LONG`
case WU_E_UNINSTALL_NOT_ALLOWED:
return `WU_E_UNINSTALL_NOT_ALLOWED`
case WU_E_INVALID_PRODUCT_LICENSE:
return `WU_E_INVALID_PRODUCT_LICENSE`
case WU_E_MISSING_HANDLER:
return `WU_E_MISSING_HANDLER`
case WU_E_LEGACYSERVER:
return `WU_E_LEGACYSERVER`
case WU_E_BIN_SOURCE_ABSENT:
return `WU_E_BIN_SOURCE_ABSENT`
case WU_E_SOURCE_ABSENT:
return `WU_E_SOURCE_ABSENT`
case WU_E_WU_DISABLED:
return `WU_E_WU_DISABLED`
case WU_E_CALL_CANCELLED_BY_POLICY:
return `WU_E_CALL_CANCELLED_BY_POLICY`
case WU_E_INVALID_PROXY_SERVER:
return `WU_E_INVALID_PROXY_SERVER`
case WU_E_INVALID_FILE:
return `WU_E_INVALID_FILE`
case WU_E_INVALID_CRITERIA:
return `WU_E_INVALID_CRITERIA`
case WU_E_EULA_UNAVAILABLE:
return `WU_E_EULA_UNAVAILABLE`
case WU_E_DOWNLOAD_FAILED:
return `WU_E_DOWNLOAD_FAILED`
case WU_E_UPDATE_NOT_PROCESSED:
return `WU_E_UPDATE_NOT_PROCESSED`
case WU_E_INVALID_OPERATION:
return `WU_E_INVALID_OPERATION`
case WU_E_NOT_SUPPORTED:
return `WU_E_NOT_SUPPORTED`
case WU_E_TOO_MANY_RESYNC:
return `WU_E_TOO_MANY_RESYNC`
case WU_E_NO_SERVER_CORE_SUPPORT:
return `WU_E_NO_SERVER_CORE_SUPPORT`
case WU_E_SYSPREP_IN_PROGRESS:
return `WU_E_SYSPREP_IN_PROGRESS`
case WU_E_UNKNOWN_SERVICE:
return `WU_E_UNKNOWN_SERVICE`
case WU_E_NO_UI_SUPPORT:
return `WU_E_NO_UI_SUPPORT`
case WU_E_PER_MACHINE_UPDATE_ACCESS_DENIED:
return `WU_E_PER_MACHINE_UPDATE_ACCESS_DENIED`
case WU_E_UNSUPPORTED_SEARCHSCOPE:
return `WU_E_UNSUPPORTED_SEARCHSCOPE`
case WU_E_BAD_FILE_URL:
return `WU_E_BAD_FILE_URL`
case WU_E_NOTSUPPORTED:
return `WU_E_NOTSUPPORTED`
case WU_E_INVALID_NOTIFICATION_INFO:
return `WU_E_INVALID_NOTIFICATION_INFO`
case WU_E_OUTOFRANGE:
return `WU_E_OUTOFRANGE`
case WU_E_SETUP_IN_PROGRESS:
return `WU_E_SETUP_IN_PROGRESS`
case WU_E_UNEXPECTED:
return `WU_E_UNEXPECTED`
case WU_E_WINHTTP_INVALID_FILE:
return `WU_E_WINHTTP_INVALID_FILE`
case WU_E_PT_HTTP_STATUS_BAD_REQUEST:
return `WU_E_PT_HTTP_STATUS_BAD_REQUEST`
case WU_E_PT_HTTP_STATUS_DENIED:
return `WU_E_PT_HTTP_STATUS_DENIED`
case WU_E_PT_HTTP_STATUS_FORBIDDEN:
return `WU_E_PT_HTTP_STATUS_FORBIDDEN`
case WU_E_PT_HTTP_STATUS_NOT_FOUND:
return `WU_E_PT_HTTP_STATUS_NOT_FOUND`
case WU_E_PT_HTTP_STATUS_BAD_METHOD:
return `WU_E_PT_HTTP_STATUS_BAD_METHOD`
case WU_E_PT_HTTP_STATUS_PROXY_AUTH_REQ:
return `WU_E_PT_HTTP_STATUS_PROXY_AUTH_REQ`
case WU_E_PT_HTTP_STATUS_REQUEST_TIMEOUT:
return `WU_E_PT_HTTP_STATUS_REQUEST_TIMEOUT`
case WU_E_PT_HTTP_STATUS_CONFLICT:
return `WU_E_PT_HTTP_STATUS_CONFLICT`
case WU_E_PT_HTTP_STATUS_GONE:
return `WU_E_PT_HTTP_STATUS_GONE`
case WU_E_PT_HTTP_STATUS_SERVER_ERROR:
return `WU_E_PT_HTTP_STATUS_SERVER_ERROR`
case WU_E_PT_HTTP_STATUS_NOT_SUPPORTED:
return `WU_E_PT_HTTP_STATUS_NOT_SUPPORTED`
case WU_E_PT_HTTP_STATUS_BAD_GATEWAY:
return `WU_E_PT_HTTP_STATUS_BAD_GATEWAY`
case WU_E_PT_HTTP_STATUS_SERVICE_UNAVAIL:
return `WU_E_PT_HTTP_STATUS_SERVICE_UNAVAIL`
case WU_E_PT_HTTP_STATUS_GATEWAY_TIMEOUT:
return `WU_E_PT_HTTP_STATUS_GATEWAY_TIMEOUT`
case WU_E_PT_HTTP_STATUS_VERSION_NOT_SUP:
return `WU_E_PT_HTTP_STATUS_VERSION_NOT_SUP`
case WU_E_PT_HTTP_STATUS_NOT_MAPPED:
return `WU_E_PT_HTTP_STATUS_NOT_MAPPED`
case WU_E_PT_WINHTTP_NAME_NOT_RESOLVED:
return `WU_E_PT_WINHTTP_NAME_NOT_RESOLVED`
default:
return ``
}
}
func (wue WUError) String() string {
return "[" + ErrorName(wue) + "] " + ErrorDesc(wue)
}
// REFERENCES:
// http://msdn.microsoft.com/en-us/library/windows/desktop/hh968413(v=vs.85).aspx (success/error codes)
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa387293(v=vs.85).aspx (network error codes)