|
25 | 25 | use Drupal\apigee_edge\Entity\Controller\DeveloperAppCredentialControllerFactoryInterface; |
26 | 26 | use Drupal\apigee_edge\Event\AppCredentialGenerateEvent; |
27 | 27 | use Drupal\Component\Utility\Random; |
| 28 | +use Drupal\Core\Utility\Error; |
28 | 29 | use Symfony\Component\EventDispatcher\EventSubscriberInterface; |
29 | 30 |
|
30 | 31 | /** |
@@ -89,29 +90,25 @@ public function overrideAppKeyOnGenerate(AppCredentialGenerateEvent $event) { |
89 | 90 | $credential_controller->addProducts($new_consumer_key, $products); |
90 | 91 | } |
91 | 92 | catch (ApiException $e) { |
92 | | - // @todo watchdog_exception() function has been deprecated for Drupal 10.1 https://www.drupal.org/node/2932520 |
93 | | - // @phpstan-ignore-next-line |
94 | | - watchdog_exception('apigee_edge', $e, 'Unable to assign API products to the newly generated API key on Apigee Edge for @app app. !message', ['@app' => "{$event->getOwnerId()}:{$event->getAppName()}"]); |
| 93 | + $logger = \Drupal::logger('apigee_edge'); |
| 94 | + Error::logException($logger, $e, 'Unable to assign API products to the newly generated API key on Apigee Edge for @app app. !message', ['@app' => "{$event->getOwnerId()}:{$event->getAppName()}"]); |
95 | 95 | try { |
96 | 96 | $credential_controller->delete($new_consumer_key); |
97 | 97 | } |
98 | 98 | catch (ApiException $e) { |
99 | | - // @todo watchdog_exception() function has been deprecated for Drupal 10.1 https://www.drupal.org/node/2932520 |
100 | | - // @phpstan-ignore-next-line |
101 | | - watchdog_exception('apigee_edge', $e, 'Unable to delete newly generated API key after API product re-association has failed on Apigee Edge for @app app. !message', ['@app' => "{$event->getOwnerId()}:{$event->getAppName()}"]); |
| 99 | + $logger = \Drupal::logger('apigee_edge'); |
| 100 | + Error::logException($logger, $e, 'Unable to delete newly generated API key after API product re-association has failed on Apigee Edge for @app app. !message', ['@app' => "{$event->getOwnerId()}:{$event->getAppName()}"]); |
102 | 101 | } |
103 | 102 | } |
104 | 103 | } |
105 | 104 | catch (ApiException $e) { |
106 | | - // @todo watchdog_exception() function has been deprecated for Drupal 10.1 https://www.drupal.org/node/2932520 |
107 | | - // @phpstan-ignore-next-line |
108 | | - watchdog_exception('apigee_edge', $e, 'Unable to create new API key on Apigee Edge for @app app. !message', ['@app' => "{$event->getOwnerId()}:{$event->getAppName()}"]); |
| 105 | + $logger = \Drupal::logger('apigee_edge'); |
| 106 | + Error::logException($logger, $e, 'Unable to create new API key on Apigee Edge for @app app. !message', ['@app' => "{$event->getOwnerId()}:{$event->getAppName()}"]); |
109 | 107 | } |
110 | 108 | } |
111 | 109 | catch (ApiException $e) { |
112 | | - // @todo watchdog_exception() function has been deprecated for Drupal 10.1 https://www.drupal.org/node/2932520 |
113 | | - // @phpstan-ignore-next-line |
114 | | - watchdog_exception('apigee_edge', $e, 'Unable to delete auto-generated key of @app app on Apigee Edge. !message', ['@app' => "{$event->getOwnerId()}:{$event->getAppName()}"]); |
| 110 | + $logger = \Drupal::logger('apigee_edge'); |
| 111 | + Error::logException($logger, $e, 'Unable to delete auto-generated key of @app app on Apigee Edge. !message', ['@app' => "{$event->getOwnerId()}:{$event->getAppName()}"]); |
115 | 112 | } |
116 | 113 | } |
117 | 114 |
|
|
0 commit comments