www/category-category-module-es5.js
/**
     * Takes an HTTP status code and returns the corresponding ErrorCode.
     * This is the standard HTTP status code -> error mapping defined in:
     * https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto
     *
     * @param status An HTTP status code.
     * @return The corresponding ErrorCode, or ErrorCode.UNKNOWN if none.
     */
Takes an HTTP status code and returns the corresponding ErrorCode.

@param status An HTTP status code.
@return The corresponding ErrorCode, or ErrorCode.UNKNOWN if none.
Takes an HTTP status code and returns the corresponding ErrorCode . @param status An HTTP status code . @return The corresponding ErrorCode or ErrorCode . UNKNOWN if none .
function codeForHTTPStatus(status) {
      if (status >= 200 && status < 300) {
        return 'ok';
      }
      switch (status) {
        case 0:
          return 'internal';
        case 400:
          return 'invalid-argument';
        case 401:
          return 'unauthenticated';
        case 403:
          return 'permission-denied';
        case 404:
          return 'not-found';
        case 409:
          return 'aborted';
        case 429:
          return 'resource-exhausted';
        case 499:
          return 'cancelled';
        case 500:
          return 'internal';
        case 501:
          return 'unimplemented';
        case 503:
          return 'unavailable';
        case 504:
          return 'deadline-exceeded';
      }
      return 'unknown';
    }
function codeForHTTPStatus ( status ) { if ( status >= 200 && status < 300 ) { return 'ok' ; } switch ( status ) { case 0 : return 'internal' ; case 400 : return 'invalid-argument' ; case 401 : return 'unauthenticated' ; case 403 : return 'permission-denied' ; case 404 : return 'not-found' ; case 409 : return 'aborted' ; case 429 : return 'resource-exhausted' ; case 499 : return 'cancelled' ; case 500 : return 'internal' ; case 501 : return 'unimplemented' ; case 503 : return 'unavailable' ; case 504 : return 'deadline-exceeded' ; } return 'unknown' ; }
Takes an HTTP status code and returns the corresponding ErrorCode.
Takes an HTTP status code and returns the corresponding ErrorCode .
// Make sure any successful status is OK. // This can happen if the server returns 500.