Skip to content

winget source update returns success (0) when it fails #2679

@o-l-a-v

Description

@o-l-a-v

Brief description of your issue

The CDN being (at least partially) broken (#2666) seems like an unhandled exception in winget-cli, as it returns success / %errorlevel 0, no?

Following running in CMD as admin should not return success IMO.

C:\Windows\system32>winget source reset --force && winget source update && echo %errorlevel%
Resetting all sources...Done
Updating all sources...
Updating source: msstore...
Done
Updating source: winget...
Cancelled
0

C:\Windows\system32>

Steps to reproduce

Change DNS to replicate CDN being down?

Expected behavior

If sources can't in fact be updated, it should return an error.

Actual behavior

Says updating sources failed, but exit code 0 = success.

Environment

Windows Package Manager v1.3.2691
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19045.2130
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.18.2691.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Command-SourceIssue related to WinGet SourceIssue-BugIt either shouldn't be doing this or needs an investigation.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions