TripOptionsError 사양

여행에서 오류를 보고할 때 사용할 유형입니다. 이 오류 유형은 GetTripOptionsGetBulkTripOptions에 공통적으로 발생합니다.

오류가 보고되면 Google은 다른 요청을 하기 전에 가변적인 시간 동안 대기합니다. 이는 성공적인 응답과 오류를 보고하는 응답 모두에 적용됩니다. 하지만 오류가 '재시도 가능'으로 표시되면 Google은 다음 요청을 전송하기 전 대기 시간을 크게 줄입니다. 이렇게 하면 오류가 일시적일 것으로 예상되는 상황에서 더 빠르게 복구할 수 있습니다.

다음 섹션에서는 trip_options_error 필드에서 반환될 수 있는 오류 유형을 설명합니다.

Proto 정의

message TripOptionsError {
  // Defines the type of error that occurred.
  // A "retryable" error indicates a transient issue, and Google may re-query
  // for the trip again shortly. A "not retryable" error indicates a
  // more permanent state, and Google will not query for this trip again in the
  // near future.
  enum TripOptionsErrorType {
    // The segment corresponding to one of the provided SegmentKeys cannot be
    // found. This error is not retryable.
    SEGMENT_KEY_NOT_FOUND = 1;

    // The data for the requested trip option is not up-to-date at the partner
    // and needs to be refreshed. For partners caching responses the refresh can
    // happen live during the API call. But if partner infrastructure or high
    // latency requires an asynchronous refresh, this error code can be used to
    // prompt Google to re-query the key later. This error is retryable.
    TRIP_OPTION_CACHE_STALE = 2;

    // An unexpected error happened during retrieval of this trip, indicating a
    // bug that needs to be fixed by the partner. This error is retryable.
    INTERNAL_ERROR = 3;

    // The trip was found but the partner considers it suboptimal and
    // chooses not to sell tickets for it. This error is not retryable.
    SUBOPTIMAL_ITINERARY = 4;

    // The trip was found but the partner is not allowed to sell tickets for it
    // due to general ticketing sale restrictions. This error is not retryable.
    TICKETING_PROHIBITED = 5;

    // The partner doesn't support pricing itineraries for the requested date.
    // This error is not retryable.
    BOOKING_WINDOW_NOT_SUPPORTED = 6;
  }

  TripOptionsErrorType error_type = 1;

  // This is not user-visible and is for logging and debugging purposes only.
  string error_message = 2;
}

TripOptionsError JSON 오류 샘플

{
  "error_type": "SEGMENT_KEY_NOT_FOUND",
  "error_message": "No matching segments found, no departures at 14:25"
}