drive-cli icon indicating copy to clipboard operation
drive-cli copied to clipboard

add error handling

Open nurdtechie98 opened this issue 6 years ago • 16 comments

At several places only ideal cases have been considered. Need error handling at all the required places

  • [ ] help
  • [ ] login
  • [ ] view-files
  • [ ] clone
  • [ ] add_remote
  • [ ] cat
  • [ ] rm
  • [ ] ls
  • [ ] status
  • [ ] pull
  • [ ] push

Note: Each section will be up for grab separately and so will be score for filling the allotted section, so claim a particular section only.

nurdtechie98 avatar Dec 29 '18 07:12 nurdtechie98

I would like to work on this issue

shikhag2018 avatar Feb 25 '19 17:02 shikhag2018

@shikhag2018 Sure. Go Ahead

inishchith avatar Feb 25 '19 18:02 inishchith

How to get started with it.

shikhag2018 avatar Feb 25 '19 18:02 shikhag2018

@shikhag2018

  • You can use try except for error and exception handling. Read more
  • Use appropriate error / exception messages

Example

inishchith avatar Feb 25 '19 18:02 inishchith

@shikhag2018 start with adding error handling for few functions where you feel there is a need of. We'll also let you know if we find other such places where you could do that in the mean time.

nurdtechie98 avatar Feb 25 '19 19:02 nurdtechie98

how to run the code of drive-cli and know what exceptions are raised or i have to manually read the code and think where execeptions can be raised.

shikhag2018 avatar Feb 26 '19 16:02 shikhag2018

Hi shikhag2018, I think manually reading the code can be tedious. It is better to try out things with an approach of finding a bug by giving buggy inputs and then handle the case. If it is pretty understandable by reading to include exception handling then you should. You can directly use drive-cli (npm install drive-cli) and test if you find bugs or follow the steps given (development mode) in the readme. Have you done that?

shivam1708 avatar Feb 26 '19 16:02 shivam1708

yes i have done the setup in both development and usage mode and i m using pip for python.

shikhag2018 avatar Feb 26 '19 16:02 shikhag2018

Sorry i wrote npm install drive-cli in flow. There is only python package. In "drive-cli/drive_cli" there is a file dcli.py which holds all the functions and utilities. In that file initially there are utility functions and from line 489 there are actual functions written for drive cli command line options. So try using different options on command line and understand the flow of execution. Once you understand that you can start testing with buggy inputs to find errors. If you have any difficulties feel free to ask :)

shivam1708 avatar Feb 26 '19 17:02 shivam1708

PTAL #29

Avni-Sharma avatar Mar 02 '19 12:03 Avni-Sharma

I have added error handling for the first two functions namely login and drive data. I also feel that a list of functions can be maintained with this issue here to which we can add error handling, as there are many people to contribute to and there are many places to add the error handling. Something like this https://github.com/kubernetes/kubernetes/issues/68026 Where every contributor contributes to a particular package similarly here every contributor can contribute to specific functions. This would be helpful in welcoming multiple contributors on board, a speedy update and independent merging of the branches.

Avni-Sharma avatar Mar 02 '19 12:03 Avni-Sharma

Agreed @Avni-Sharma , I have create checklist and we can start with separate contributions for each individual functionality.

nurdtechie98 avatar Mar 05 '19 15:03 nurdtechie98

I would like to work on cat command!

udit-001 avatar May 21 '19 12:05 udit-001

sure @udit-001 go ahead

nurdtechie98 avatar May 21 '19 13:05 nurdtechie98

@nurdtechie98 Done, please review!

udit-001 avatar May 29 '19 14:05 udit-001

Can I work on log command, I noticed it requires error handling as well but it isn't mentioned in this thread? @inishchith

udit-001 avatar May 31 '19 12:05 udit-001