UNPKG

@dgac/nmb2b-client

Version:

EUROCONTROL Network Manager B2B SOAP client

59 lines (58 loc) 1.34 kB
// src/utils/NMB2BError.ts var NMB2BError = class extends Error { constructor({ reply }) { super(); if (reply.requestId) { this.requestId = reply.requestId; } if (reply.requestReceptionTime) { this.requestReceptionTime = reply.requestReceptionTime; } if (reply.sendTime) { this.sendTime = reply.sendTime; } if (reply.inputValidationErrors) { this.inputValidationErrors = reply.inputValidationErrors; } if (reply.warnings) { this.warnings = reply.warnings; } if (reply.slaError) { this.slaError = reply.slaError; } if (reply.reason) { this.reason = reply.reason; } this.status = reply.status; this.message = this.status; if (this.reason) { this.message = `${this.message}: ${this.reason}`; } } }; // src/utils/extractReferenceLocation.ts var keys = [ "ReferenceLocationAirspace", "ReferenceLocationAerodrome", "ReferenceLocationAerodromeSet", "ReferenceLocationDbePoint", "ReferenceLocationPublishedPoint" ]; function extractReferenceLocation(prefix, input) { if (!input) { return; } for (const k of keys) { const key = `${prefix}-${k}`; if (key in input) { return input[key]; } } } export { NMB2BError, extractReferenceLocation }; //# sourceMappingURL=index.js.map