TripOptionsError specification
Stay organized with collections
Save and categorize content based on your preferences.
Types to be used when reporting an error on a trip. This error type is common to
GetTripOptions
and GetBulkTripOptions
.
When an error is reported, Google will wait a variable length of time
before making another request. This applies to both successful responses and
responses that report errors. However, if an error is marked as "Retryable",
Google will significantly reduce the waiting time before issuing the next
request. This allows for faster recovery in situations where the error is
expected to be transient.
The following section describes the error types that can be returned in the
trip_options_error
field:
Proto Definition
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 Sample
{
"error_type": "SEGMENT_KEY_NOT_FOUND",
"error_message": "No matching segments found, no departures at 14:25"
}
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-22 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-22 UTC."],[],[],null,["# TripOptionsError specification\n\nTypes to be used when reporting an error on a trip. This error type is common to\n`GetTripOptions` and `GetBulkTripOptions`.\n\nWhen an error is reported, Google will wait a variable length of time\nbefore making another request. This applies to both successful responses and\nresponses that report errors. However, if an error is marked as \"Retryable\",\nGoogle will significantly reduce the waiting time before issuing the next\nrequest. This allows for faster recovery in situations where the error is\nexpected to be transient.\n\nThe following section describes the error types that can be returned in the\n`trip_options_error` field: \n\n### Proto Definition\n\n```protobuf\nmessage TripOptionsError {\n // Defines the type of error that occurred.\n // A \"retryable\" error indicates a transient issue, and Google may re-query\n // for the trip again shortly. A \"not retryable\" error indicates a\n // more permanent state, and Google will not query for this trip again in the\n // near future.\n enum TripOptionsErrorType {\n // The segment corresponding to one of the provided SegmentKeys cannot be\n // found. This error is not retryable.\n SEGMENT_KEY_NOT_FOUND = 1;\n\n // The data for the requested trip option is not up-to-date at the partner\n // and needs to be refreshed. For partners caching responses the refresh can\n // happen live during the API call. But if partner infrastructure or high\n // latency requires an asynchronous refresh, this error code can be used to\n // prompt Google to re-query the key later. This error is retryable.\n TRIP_OPTION_CACHE_STALE = 2;\n\n // An unexpected error happened during retrieval of this trip, indicating a\n // bug that needs to be fixed by the partner. This error is retryable.\n INTERNAL_ERROR = 3;\n\n // The trip was found but the partner considers it suboptimal and\n // chooses not to sell tickets for it. This error is not retryable.\n SUBOPTIMAL_ITINERARY = 4;\n\n // The trip was found but the partner is not allowed to sell tickets for it\n // due to general ticketing sale restrictions. This error is not retryable.\n TICKETING_PROHIBITED = 5;\n\n // The partner doesn't support pricing itineraries for the requested date.\n // This error is not retryable.\n BOOKING_WINDOW_NOT_SUPPORTED = 6;\n }\n\n TripOptionsErrorType error_type = 1;\n\n // This is not user-visible and is for logging and debugging purposes only.\n string error_message = 2;\n}\n```\n\n### TripOptionsError JSON Error Sample\n\n {\n \"error_type\": \"SEGMENT_KEY_NOT_FOUND\",\n \"error_message\": \"No matching segments found, no departures at 14:25\"\n }"]]