feature: Initial info gathering

This commit is contained in:
Keith Solomon
2026-02-08 23:25:50 -06:00
parent e1a144480d
commit 58353b249a
9 changed files with 1153 additions and 8 deletions

View File

@@ -0,0 +1,52 @@
<?php
/**
* Spacetraders API Exception Class
*
* PHP version 7.4
*
* @category Exception
* @package Spacetraders
* @author Keith Solomon <keith@keithsolomon.net>
* @license MIT License
* @link https://github.com/your-repo/spacetraders
*/
/**
* Custom exception class for Spacetraders API related errors.
*
* This exception is thrown when API calls to the Spacetraders service
* encounter errors such as network issues, invalid responses, authentication
* failures, or other API-specific problems.
*
* @extends RuntimeException
*/
class SpacetradersApiException extends RuntimeException {
/**
* Error payload data from the API response.
*
* @var array<string,mixed>
*/
protected array $errorPayload = array();
/**
* Constructor for SpacetradersApiException.
*
* @param string $message The exception message.
* @param int $code The exception code (default: 0).
* @param array<string,mixed> $errorPayload The error payload from API response (default: empty array).
*/
public function __construct( string $message, int $code = 0, array $errorPayload = array() ) {
parent::__construct( $message, $code );
$this->errorPayload = $errorPayload;
}
/**
* Get the error payload from the API response.
*
* @return array<string,mixed>
*/
public function getErrorPayload(): array {
return $this->errorPayload;
}
}