We currently have a problem, that e.g. LTIMessageLaunch::getPublicKey() fails in the method ILtiServiceConnector::makeRequest.
In its implementation, a debugLog is supported:
public function makeRequest(IServiceRequest $request)
{
$response = $this->client->request(
$request->getMethod(),
$request->getUrl(),
$request->getPayload()
);
if ($this->debuggingMode) {
$this->logRequest(
$request,
$this->getResponseHeaders($response),
$this->getResponseBody($response)
);
}
return $response;
}
However, when $this->client->request() throws an Exception, you will not get that debug log.
Also, it is catched like this:
I think it would be great if either the exception is thrown with new LtiException(static::ERR_NO_PUBLIC_KEY, previous: $e) or the debug mode is able to log even when an exception is thrown, so the users of this library are able to find the underlying issue of this exception in some way.
We currently have a problem, that e.g. LTIMessageLaunch::getPublicKey() fails in the method ILtiServiceConnector::makeRequest. In its implementation, a debugLog is supported:
However, when
$this->client->request()
throws an Exception, you will not get that debug log. Also, it is catched like this:I think it would be great if either the exception is thrown with
new LtiException(static::ERR_NO_PUBLIC_KEY, previous: $e)
or the debug mode is able to log even when an exception is thrown, so the users of this library are able to find the underlying issue of this exception in some way.