vegaprotocol / vegawallet-desktop

Desktop application for Vega Protocol's wallet
MIT License
15 stars 12 forks source link

fix: add validation on vegahome path set in app-config #518

Closed wwestgarth closed 1 year ago

wwestgarth commented 1 year ago

closes #504 closes #436

wwestgarth commented 1 year ago

Can we add a check on the LogLevel to verify it has a valid value ?

They are already validated slightly above in the diff:

if err := vgzap.EnsureIsSupportedLogLevel(c.LogLevel); err != nil {
        return err
    }

Had a fiddle to confirm and from the UI there is a dropdown so its not possible to choose a wrong value. If I edit the config file by hand to have either no value, or an unsupported value you get:

Screenshot 2023-02-21 at 14 58 22 Screenshot 2023-02-21 at 14 58 42

get:

ValentinTrinque commented 1 year ago

Can we add a check on the LogLevel to verify it has a valid value ?

They are already validated slightly above in the diff:


if err := vgzap.EnsureIsSupportedLogLevel(c.LogLevel); err != nil {

      return err

  }

Had a fiddle to confirm and from the UI there is a dropdown so its not possible to choose a wrong value. If I edit the config file by hand to have either no value, or an unsupported value you get:

Screenshot 2023-02-21 at 14 58 22 Screenshot 2023-02-21 at 14 58 42

get:

Oh sure sorry my bad 🤦‍♂️