gotransip icon indicating copy to clipboard operation
gotransip copied to clipboard

Fix error message when no private key is provided

Open seveas opened this issue 4 years ago • 2 comments

Short description

This error had me confused for a minute. Had to read this file to realize that I passed an empty string as PrivateKeyPath

Checklist

  • [x] I read the CONTRIBUTING.md document
  • [x] This code actually compiles
  • [x] This code solves my problem
  • [ ] I've updated the inline documentation
  • [ ] I added or modified test(s) to prevent this issue from ever occuring again

Last 2 are not really applicable 😃

seveas avatar Oct 22 '21 17:10 seveas

Hi @seveas,

This will make the test expecting that error also fail. Could you also change that test?

--- FAIL: TestNewClient (0.00s)
    client_test.go:48: 
                Error Trace:    client_test.go:48
                Error:          Error message not equal:
                                expected: "PrivateKeyReader, token or PrivateKeyReader is required"
                                actual  : "PrivateKeyPath, token or PrivateKeyReader is required"
                Test:           TestNewClient
FAIL

dionbosschieter avatar Nov 05 '21 14:11 dionbosschieter

Certainly! Apologies for the sloppy pr.

seveas avatar Nov 11 '21 08:11 seveas