- Issue created by @apotek
Hi, when things go wrong, it can be very difficult to see what request triggered the error.
Blackbaud::requestResponse() output error messages and HTTP error codes, but the logging output does not indicate what request generated the error.
Either:
1. Add a debug level log for each request at time of request:
try {
// Try the request.
+ \Drupal::logger('Blackbaud SKY API')->debug('HTTP :type request to :url', [':type' => $type, ':url' => $this->getUrl()]);
$response = $client->request($type, $this->getUrl(), $options);
The above added line could also be wrapped in a config check, like so:
+ if (\Drupal::service('config.manager')->getConfigFactory()->get('blackbaud_sky_api.settings')->get('debug')) {
+ \Drupal::logger('Blackbaud SKY API')->debug('HTTP :type request to :url', [':type' => $type, ':url' => $this->getUrl()]);
+ }
$response = $client->request($type, $this->getUrl(), $options);
2. Or, to save log output, add method and url only to the various error messages.
1. Discuss preferred approach and
2. Post a merge request
none
none
none
Active
1.0
Code