Skip to content

Commit

Permalink
Update Httpie.php
Browse files Browse the repository at this point in the history
improve error message for empty url on HTTPie
  • Loading branch information
Schrank committed Jan 31, 2023
1 parent b71b9bc commit aa6a9b8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Utility/Httpie.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ public function nothrow(bool $on = true): Httpie

public function send(?array &$info = null): string
{
if($this->url === '') {
throw new \RuntimeException('URL must not be empty to Httpie::send()');
}
$ch = curl_init($this->url);
curl_setopt($ch, CURLOPT_USERAGENT, 'Deployer ' . DEPLOYER_VERSION);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->method);
Expand Down

0 comments on commit aa6a9b8

Please sign in to comment.