Think about the ways users could misuse our code and add some error checking to guard against it.
Some examples to start:
- In
def data(), the returnType param could be an invalid string. Ways to guard against that include:
- do a
.lower() or .upper() on returnType before the comparison
- before the comparison, check if the value of
returnType is one of the supported values, and if it isn't, throw an error that tells the user what the valid options are
- In
def download(), the fileFormat param could be an invalid string.
- Maybe check if
fileFormat is one of the supported formats, and if it isn't, throw an error that tells the user what the valid formats are
Think about the ways users could misuse our code and add some error checking to guard against it.
Some examples to start:
def data(), thereturnTypeparam could be an invalid string. Ways to guard against that include:.lower()or.upper()onreturnTypebefore the comparisonreturnTypeis one of the supported values, and if it isn't, throw an error that tells the user what the valid options aredef download(), thefileFormatparam could be an invalid string.fileFormatis one of the supported formats, and if it isn't, throw an error that tells the user what the valid formats are