azure-sdk-for-java icon indicating copy to clipboard operation
azure-sdk-for-java copied to clipboard

Validate parameter for each public method in Java SDK

Open gcheng opened this issue 14 years ago • 2 comments

The parameters should be validated and appropriate exceptions should be thrown such as IllegalArgumentException.

gcheng avatar Jul 17 '12 22:07 gcheng

The design we've been using for the APIs is to:

  1. If bad data will cause the SDK code to error in other helper methods, which results in a confusinng client error (see #42), then validate those parameters.
  2. If bad data causes the SDK to form a bad request, which results in a confusing server error (see #121), then validate those parameter.
  3. Else, rely on the server to return a sensible error.

In general, most of the APIs abide by these rules. Please file seperate issues for specific classes of problems.

jcookems avatar Jul 17 '12 22:07 jcookems

Close this since we should file separate issues for specific problems.

guangyang avatar Jan 22 '13 02:01 guangyang