clh: Add some error handling for clh#2863
Conversation
|
Thank you for raising your pull request. Please note that the main development of Kata Containers has moved to the 2.0-dev branch of https://github.com/kata-containers/kata-containers repository. The kata-containers/runtime repository is kept for 1.x release maintenance. Please check twice if your change should go to the 2.0-dev branch directly. If it is strongly required for adding the change to Kata Containers 1.x releases, please ping @kata-containers/runtime to assign a dedicated developer to be responsible for porting the change to 2.0-dev branch. Thanks! |
|
/test-ubuntu |
221d5f8 to
b42a4e6
Compare
Codecov Report
@@ Coverage Diff @@
## master #2863 +/- ##
==========================================
+ Coverage 51.05% 51.40% +0.34%
==========================================
Files 118 118
Lines 17364 17441 +77
==========================================
+ Hits 8866 8965 +99
+ Misses 7419 7393 -26
- Partials 1079 1083 +4 |
| major, err := strconv.ParseUint(versionSplit[0], 10, 64) | ||
| if err != nil { | ||
| return err | ||
| return fmt.Errorf("Failed to parse cloud-hypervisor version: %s, Unexpected format", words[1]) |
There was a problem hiding this comment.
- if we get to this error scenario, something unexpected happened so maybe
words[1]isn't what we expect either. As such, I'd consider loggingwords, not justwords[1](same comment for the other errors below). - To help with debugging, you might want to log
wordswhen the check on the number of fields above fails too?
There was a problem hiding this comment.
Agree. I am using words in all error logs now. Thanks.
b42a4e6 to
ada0467
Compare
|
/test-ubuntu |
|
Travis CI is complaining, and it looks like some formatting issue? |
|
@likebreath Yes, I was just taking a look at that. But I cant seem to figure out why. Running |
|
@amshinde Looks like your gofmt is different from ours... I have the following by running gofmt on your PR. You can remove the changes you made in your PR, and the Travis CI should be happy. |
| {"panic", "1"}, // upon kernel panic wait 1 second before reboot | ||
| {"no_timer_check", ""}, // do not check broken timer IRQ resources | ||
| {"noreplace-smp", ""}, // do not replace SMP instructions |
There was a problem hiding this comment.
This is where gofmt is not happy about. Looks like your gofmt made the change?
The function for getting version info was failing on a system without any indication of the error. Add some error handling around this function. Fixes: github.com/kata-containers/kata-containers#463 Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
ada0467 to
c87ff44
Compare
|
/test-ubuntu |
The function for getting version info was failing on a system
without any indication of the error. Add some error handling
around this function.
Fixes: github.com/kata-containers/kata-containers#463
Signed-off-by: Archana Shinde archana.m.shinde@intel.com