Skip to main content

Connectors Error Handling

This section explains how Connectors report errors, warnings, and informational messages through the AdviseMessage object. It describes every property of the object, the full list of codes with their equivalences in the Legacy and HotelX Buyer APIs, when the external object is filled, and the helper methods available when building a Connector.

Because Buyers can download Connector traces from Logging, this reference is useful both for Connector developers (to raise the right message) and for Buyers (to interpret the messages they receive).


AdviseMessage Overview​

An AdviseMessage conveys the outcome of an operation in a standardized way. It is made up of the following properties:

PropertyDescription
codeThe message type as a readable name (e.g. SupplierError, ItemNotAvailable). See the equivalence table.
levelThe severity of the message: Error, Warning, or Info.
descriptionA human-readable, default explanation of the message.
externalOptional supplier-specific details (supplier code, message, and HTTP status code). See The external object.
idThe numeric identifier of the code (e.g. ItemNotAvailable β†’ 11301).
legacyIdThe equivalent Legacy error code, also surfaced as the HotelX error type (e.g. 11301 β†’ 301).
correlationIdAn identifier used to correlate the message with a specific operation or request.
info

In the API response the property names are serialized in camelCase (code, level, description, external, id, legacyId, correlationId). The code field carries the name of the message (not its number); the numeric value is available in id.

Example of an AdviseMessage​

{
"adviseMessages": [
{
"code": "ItemNotAvailable",
"description": "Option not found in quote",
"external": {
"httpStatusCode": 200,
"message": "Option not found in quote: Parameters not found (1). Total options to try to do match: 3 ..."
},
"id": 11301,
"legacyId": 301,
"level": "Error"
}
]
}

Understanding code, id, and legacyId​

Each message is defined by a single code. From that code two numeric identifiers are derived automatically:

  • id β€” the native Connectors numeric identifier of the code. It is stable and specific to Connectors.
  • legacyId β€” the equivalent code in the Legacy Pull API. This same value is what the HotelX API returns as the error/warning type for messages that originate from the connection with the Seller.

This means a single Connectors message can be traced across the three APIs:

AdviseMessage.code (Connectors) β†’ id (Connectors numeric) β†’ legacyId (Legacy code = HotelX type)

For the meaning of each Legacy/HotelX code, see the Legacy Avail errors and the HotelX errors and warnings documentation.

How the id is built​

Connectors codes follow a standard so that common codes can be reused consistently. The first two digits of the id encode the nature and origin of the message:

  • First digit β€” type of message:
    • 1 β†’ Business
    • 2 β†’ Systems
    • 3 β†’ Communication
  • Second digit β€” origin of the message:
    • 1 β†’ External (raised by a service external to Travelgate, i.e. the Seller/supplier)
    • 2 β†’ Internal (raised by a Travelgate service)

The remaining digits identify the specific message within that category.

For example, 11102 (SupplierError) is a Business (1) error from an External (1) service, whereas 22101 (InternalError) is a Systems (2) error Internal (2) to Travelgate, and 31105 (SupplierConnectionError) is a Communication (3) error from an External (1) service.

info

The level property is independent of this numbering and indicates the importance of the message (Error, Warning, Info). The external service's own code/message is detailed in the external object β€” see The external object.


Code Equivalence Table​

The following table lists every AdviseMessage code, its Connectors id, the default severity level, the equivalent legacyId (Legacy code / HotelX type), the default description, and whether the external object is included.

The External column indicates:

  • Required β€” the message is always raised with an external object.
  • Optional β€” an external object may be included when the supplier returns additional details.
  • Not included β€” the message never carries an external object (it is generated internally by Connectors).
CodeidlevellegacyId (Legacy / HotelX)Default descriptionExternal
SupplierError11102Error102Supplier errorRequired
SupplierBadRequest11207Error102Bad request to supplierOptional
SupplierSessionExpired11205Error102Session expiredOptional
SupplierResponseNotSerializable11206Error102Supplier request or response cannot be deserializedOptional
PriceChanged11304Error102Price changedOptional
BookingNotFound11305Error102Booking not foundOptional
Unauthorized12401Error102UnauthorizedOptional
SupplierNoResultsFound11204Warning204No results foundOptional
BadRequest12207Error207Request not accepted by supplierOptional
NotImplemented12501Info207Operation not implementedNot included
ItemNotAvailable11301Error301Option not found in quoteOptional
ItemNotFoundInContent11302Error302Hotel not foundNot included
SupplierBookingNotConfirmed11303Error303Booking not confirmedOptional
InternalError22101Error101Internal errorOptional
ExtraOperationConnectionError22105Error105Internal connection errorNot included
SupplierResponseMaxSizeExceeded22106Error105Supplier response size exceeded maximum allowedOptional
MaxOptionsExceeded22107Error101Maximum number of options exceededOptional
SupplierTooManyRequests31103Error103Too many requests to the supplierRequired
SupplierTimeout31104Error104Connection timeout with supplierOptional
SupplierConnectionError31105Error105Communication errorRequired
RequestAbortedByClient12106Error106Request aborted by clientNot included
InternalWarning12290Warning0 (OK)Internal WarningOptional
SupplierWarning11291Warning0 (OK)Supplier Warning, check external for more detailsRequired
info

Messages with level Warning or Info do not map to a Legacy/HotelX error code, so their legacyId is 0 (OK).

Legacy / HotelX code reference​

For convenience, these are the meanings of the legacyId values used above:

legacyIdMeaning
0OK (no error, warning/info only)
101System error / Internal error
102Provider (supplier) error
103Too many requests
104Connection timeout with provider
105Communication error
106Request aborted by client
204No results found
207Request not accepted by supplier
301Option not found in Valuation / Quote
302Hotel not found
303Booking not confirmed

The external object​

The external object carries the supplier-specific context behind a message. It is especially useful for tracing and diagnosing issues that originate on the Seller's side.

Fields​

FieldDescription
codeThe supplier's own code identifying the response or error. Optional β€” it is only present when the supplier provides it. It is not a Connectors code.
messageA descriptive, human-readable message returned by (or built from) the supplier's response.
httpStatusCodeThe HTTP status code of the supplier's response (e.g. 200, 400, 500). Defaults to 200 when not applicable.
{
"code": "E9999.1",
"message": "Supplier internal error",
"httpStatusCode": 500
}

When is external filled?​

Whether an AdviseMessage includes an external object depends on the code, as shown in the External column of the equivalence table:

  • Required β€” the message is always accompanied by an external object (e.g. SupplierError, SupplierConnectionError, SupplierTooManyRequests, SupplierWarning). Use it to inspect the supplier's own response.
  • Optional β€” an external object is added when the supplier returns additional details, but it may be absent otherwise.
  • Not included β€” the message is generated internally by Connectors and never carries an external object (e.g. ItemNotFoundInContent, NotImplemented, ExtraOperationConnectionError, RequestAbortedByClient).
tip

When troubleshooting a supplier-originated error, always check external.message and external.httpStatusCode first β€” they contain the raw context returned by the Seller, which is not reflected in the standardized description.


Helper Methods​

When building a Connector, always use the provided helper methods to generate AdviseMessage instances so that the code, level, description, and external handling stay consistent across all Connectors.

External class definition​

public class External
{
public string Code { get; init; } // Supplier-specific code (optional)
public string Message { get; init; } // Human-readable message from the supplier
public int HttpStatusCode { get; init; } // HTTP status code of the supplier's response

public External(string code, string message, int httpStatusCode = 200)
{
Code = code;
Message = message;
HttpStatusCode = httpStatusCode;
}
}

Example: adding external details to an error​

var externalDetails = new External(
code: "ERR-TIMEOUT",
message: "The supplier timed out after 30 seconds.",
httpStatusCode: 504
);

var adviseMessage = AdviseMessage.BuildSupplierTimeout(externalDetails);

Common helper methods​

MethodDescription
BuildSupplierErrorCreates a generic supplier error message.
BuildSupplierBadRequestCreates a message for bad requests to the supplier.
BuildSupplierBookingNotConfirmedIndicates the supplier did not confirm the booking.
BuildSupplierTimeoutIndicates the supplier timed out during the operation.
BuildSupplierConnectionErrorCreates a message for connection errors with the supplier.
BuildSupplierNoResultsCreates a warning message indicating no results were found.
BuildOptionNotFoundInQuoteIndicates the option is no longer available during Quote.
BuildHotelNotFoundInContentIndicates the requested hotel was not found in content.
BuildInternalErrorCreates an internal Connector error message.

Implementation Best Practices​

  • Use helper methods: Always generate AdviseMessage instances with the provided helpers to ensure consistency across Connectors.
  • Map supplier errors: When processing supplier responses, map their error codes or messages to the appropriate AdviseMessageCode.
  • Fill external for supplier issues: Include the supplier's code, message, and httpStatusCode whenever the error originates on the Seller's side.
  • Validate responses: Use validation methods like TryValidateSupplierResponses to check supplier responses and generate appropriate messages.

Example Implementation​

public static bool TryValidateSupplierResponses<TRs>(
IEnumerable<SupplierResponseWrapper<TRs>> supplierResponses,
out IEnumerable<AdviseMessage> adviseMessages)
where TRs : BaseResponse
{
var firstResponse = supplierResponses.First();

if (firstResponse.Response.Error?.Count > 0)
{
var messages = firstResponse.Response.Error.Select(error =>
error.Mensaje == "Sin disponibilidad"
? AdviseMessage.BuildSupplierNoResults(new External("", error.Mensaje, 200))
: AdviseMessage.BuildSupplierError(new External("", error.Mensaje, 500))
).ToList();

adviseMessages = messages;
return false;
}

adviseMessages = null;
return true;
}