I have found this for two scenario.
1. Wrong API Secret Key (not empty)
2. If Maximum credits exceeded for an account

-> For the above scenario, it throws 500 error with the Guzzle exception having the message of "400 Bad Request", it must trhow 400 and also the site must not to break down, isn't it?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Rajandro created an issue. See original summary.

baikho’s picture

Version: 8.x-1.2 » 8.x-1.x-dev
Status: Active » Needs review
FileSize
1.12 KB

See patch, fixing the uncaught exceptions. (tested on 8.x-1.x)

Status: Needs review » Needs work

The last submitted patch, 2: sendgrid_integration-2992765-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

attheshow’s picture

I ran into this same issue. Nice patch to catch the exception!

Perignon’s picture

Title: 400 Bad Request » 400 Bad Request - Handle exception returned from SendGrid without crashing site

  • Perignon committed 1417c06 on 8.x-1.x authored by Baik Ho
    Issue #2979620 by Baik Ho: 400 Bad Request - Handle exception returned...
Perignon’s picture

Thanks for the patch! Committed to Dev.

Perignon’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rajandro’s picture