Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Steps to reproduce:
- Set up a google api key which is incorrect (any random string would do, but for a more common scenario, try a google browser key that was not activated for the Google Vision api).
- Set up a content type / fields as indicated on the module's instructions
- Create a content with a sample image, click "Save"
- WSOD
Proposed resolution
Use a Try/Catch to handle the exception raised by the http client if the response to the POST is not successful
Comment | File | Size | Author |
---|---|---|---|
#2 | use-try-catch-to-prevent-fatal-with-bad-api-key-2783005-2.patch | 1.36 KB | marcoscano |
|
Comments
Comment #2
marcoscanoComment #3
naveenvalechaLooks good.
There's already a task here #2736567: Handle errors in Response Closing that as duplicate.
Comment #5
naveenvalechaCommitted and pushed to 8.x-1.x
Thanks!