mirror of
https://github.com/tiny-pilot/tinypilot.git
synced 2021-09-19 22:56:27 +03:00
There was a bug in the error recording logic of update-service. Previously, if an error occurred during the try/catch, it was recorded in the update result's error field, but then the last line of the function overwrote any error with an empty string, erasing the record of the error. This rewrites the logic so that each exit path generates its own update result object, so it's harder for values from one result to bleed into another code path. This also changes the semantics of the success case so that error=None instead of error=''. In #659, we updated all instances of the error field to use error=None to represent success, but we missed the usage in update-service. Fixes #665