Skip to content

Commit 23903da

Browse files
committed
Always return HttpTransportException that includes the request URI
1 parent 0fc41dd commit 23903da

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/HttpClient/Plugin/ExceptionThrower.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
use Http\Client\Common\Plugin;
1313
use PrivatePackagist\ApiClient\Exception\ErrorException;
14+
use PrivatePackagist\ApiClient\Exception\HttpTransportException;
1415
use PrivatePackagist\ApiClient\Exception\ResourceNotFoundException;
1516
use PrivatePackagist\ApiClient\Exception\RuntimeException;
1617
use PrivatePackagist\ApiClient\HttpClient\Message\ResponseMediator;
@@ -45,7 +46,7 @@ public function handleRequest(RequestInterface $request, callable $next, callabl
4546
}
4647
}
4748

48-
throw new RuntimeException(isset($content['message']) ? $content['message'] : $content, $response->getStatusCode());
49+
throw new HttpTransportException(isset($content['message']) ? $content['message'] : $content, $response->getStatusCode(), $request->getUri());
4950
});
5051
}
5152
}

0 commit comments

Comments
 (0)