Skip to content

Commit

Permalink
fix: error handling in case of return code 502 (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rakdos8 authored May 17, 2023
1 parent 80eedc4 commit 3e38f0b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Containers/EsiResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ public function __construct(
$this->error_message .= ': ' . $data->error_description;
}

// If the query failed to contact the ESI endpoint
if ($this->response_code === 502)
$this->error_message = 'Bad gateway';

// Run the parent constructor
parent::__construct(is_array($data) ? (array) $data : (object) $data, ArrayObject::ARRAY_AS_PROPS);
}
Expand Down

0 comments on commit 3e38f0b

Please sign in to comment.