lib/validate.js
function httpResponse (response) {
  if (!response) {
    throw new Error('Unable to parse response.')
  }
  const errorAttrs = response.Chyba && response.Chyba.attributes
  if (errorAttrs) {
    throw new Error(`${response.Chyba.$value} (${errorAttrs.kod})`)
  }
  const body = response.Potvrzeni && response.Potvrzeni.attributes
  const header = response.Hlavicka && response.Hlavicka.attributes
  if (!body || !header) {
    throw new Error('Unable to read response.')
  }
}
function httpResponse (response) {
  if (!response) {
    throw new Error('Unable to parse response.')
  }
  const errorAttrs = response.Chyba && response.Chyba.attributes
  if (errorAttrs) {
    throw new Error(`${response.Chyba.$value} (${errorAttrs.kod})`)
  }
  const body = response.Potvrzeni && response.Potvrzeni.attributes
  const header = response.Hlavicka && response.Hlavicka.attributes
  if (!body || !header) {
    throw new Error('Unable to read response.')
  }
}
function httpResponse ( response ) { if ( ! response ) { throw new Error ( 'Unable to parse response.' ) } const errorAttrs = response . Chyba && response . Chyba . attributes if ( errorAttrs ) { throw new Error ( ` ${ response . Chyba . $value } ${ errorAttrs . kod } ` ) } const body = response . Potvrzeni && response . Potvrzeni . attributes const header = response . Hlavicka && response . Hlavicka . attributes if ( ! body || ! header ) { throw new Error ( 'Unable to read response.' ) } }
Zpracuje chybnou odpoved.
Zpracuje chybnou odpoved .