Problem/Motivation
When a user submits a cache invalidation request using CloudfrontCacheInvalidateForm, and AWS API return a non-successful response code (e.g. 503), thus triggering an Exception, currently only a log message is added. The user should be notified when such error occurs.
Steps to reproduce
- Go to /admin/config/services/cloudfront-invalidate-url
- Submit an invalidation request by typing a URL and click Invalidate URL
- (You can simulate an AWS error by supplying a wrong key/secret)
- The success message "Cloudfront Cache invalidation is in progress. " displays instead of an error.
Proposed resolution
Display an error to the user when AWS API returns an error.
Remaining tasks
Write a patch to add a messenger->addError to display the error.
User interface changes
Display an error to the user when AWS API returns an error.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3307362-2--display-error-message.patch | 900 bytes | andrew.wang |
Comments
Comment #2
andrew.wang commentedComment #3
prashant mishra commentedPatch applied to new release 3.0.2
https://www.drupal.org/project/cloudfront_cache_path_invalidate/releases...
Comment #4
andrew.wang commented