error_code = $error_code; $this->additional_data = array_filter( (array) $additional_data ); parent::__construct( $message, $http_status_code ); } /** * Returns the error code. * * @return string The machine-readable error code. */ public function getErrorCode(): string { return $this->error_code; } /** * Returns additional error data. * * @return array Extra data (key value pairs). */ public function getAdditionalData(): array { return $this->additional_data; } }