Skip to content
This repository has been archived by the owner on Jul 30, 2023. It is now read-only.

handle panic #69

Merged
merged 1 commit into from
May 7, 2021
Merged

handle panic #69

merged 1 commit into from
May 7, 2021

Conversation

hidetatz
Copy link
Owner

@hidetatz hidetatz commented May 7, 2021

WHAT

Handle panic in Print. When recover(), uncolored output will be shown.

WHY

When "kubecolor plugin_name version" or so on is specified, is should not colorize because kubecolor does not support plugins.
However, right now, kubecolor thinks "plugin_name" is a command-line option and the subcommand is "version" (= "kubectl version"). Then, VersionPrinter is called but it fail to parse then panic.

Ideally, it should understand if the given command is running plugin or not, but it seems like it is likely impossible.
This is just a workaround to "accept" mis parsing and panic.

Related issue (if exists)

#68

@codecov-commenter
Copy link

codecov-commenter commented May 7, 2021

Codecov Report

Merging #69 (1db9c95) into main (330bb02) will decrease coverage by 0.55%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #69      +/-   ##
==========================================
- Coverage   84.34%   83.78%   -0.56%     
==========================================
  Files          18       18              
  Lines         594      592       -2     
==========================================
- Hits          501      496       -5     
- Misses         84       88       +4     
+ Partials        9        8       -1     
Impacted Files Coverage Δ
command/runner.go 0.00% <0.00%> (ø)
command/subcommand.go 84.00% <ø> (+6.22%) ⬆️
kubectl/subcommand.go 90.62% <ø> (-0.68%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 330bb02...1db9c95. Read the comment docs.

@hidetatz hidetatz merged commit d00a659 into main May 7, 2021
@hidetatz hidetatz deleted the dty1er/handle_panic branch May 7, 2021 06:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants