cdbg: better error reporting on deploy failure (#3155)

* Don't report `UPLOAD_FILES_START_FAILED` as unknown error
* Return error to `cdbg` if present

---------

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2024-06-07 15:46:37 +02:00 committed by GitHub
parent 095a66fb83
commit 32588339f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 82 additions and 68 deletions

View file

@ -106,6 +106,7 @@ func (s *debugdServer) UploadFiles(stream pb.Debugd_UploadFilesServer) error {
s.log.With(slog.Any("error", err)).Error("Uploading files failed")
return stream.SendAndClose(&pb.UploadFilesResponse{
Status: pb.UploadFilesStatus_UPLOAD_FILES_UPLOAD_FAILED,
Error: err.Error(),
})
}
@ -124,6 +125,7 @@ func (s *debugdServer) UploadFiles(stream pb.Debugd_UploadFilesServer) error {
s.log.With(slog.Any("error", overrideUnitErr)).Error("Overriding service units failed")
return stream.SendAndClose(&pb.UploadFilesResponse{
Status: pb.UploadFilesStatus_UPLOAD_FILES_START_FAILED,
Error: overrideUnitErr.Error(),
})
}
return stream.SendAndClose(&pb.UploadFilesResponse{