expected<Something, Error> should never allow construction from Error without unexpected()

Description

Since the mender (and mender-flash) repository switched from our custom implementation of the expected template class, expected<Something, Error> value(Error(...)) no longer creates a value wrapping the unexpected error, it either fails to compile or somehow treats the Error as a valid value of Something! unexpected(Error(...)) must be required and enforced by the compiler for all cases in the codebase.

Cases where the weird behavior was unnoticed because it compiled just fine:

Affects versions

None

Environment

None

Activity

Show:

Vratislav PodzimekApril 6, 2023 at 1:12 PM

Fixed

Details

Assignee

Reporter

Priority

Days in progress

0

Backlog

yes

Zendesk Support

Checklist

Created March 23, 2023 at 12:00 PM
Updated April 6, 2023 at 1:13 PM
Resolved April 6, 2023 at 1:13 PM