A New Collection of Thoughtful Learning Apps — Now Available on iOS & Android

Image
I’m excited to share a set of mobile apps I’ve recently completed and published on both the Google Play Store and the Apple App Store. These apps are designed with a simple goal in mind: to make meaningful, structured content more accessible, whether you’re studying theology or improving your English vocabulary. 📱 Now Available on Both Platforms All apps are live and available for download: Google Play Developer Page: https://play.google.com/store/apps/dev?id=5835943159853189043 Apple App Store Developer Page: https://apps.apple.com/ca/developer/q-z-l-corp/id1888794100 📖 Theology & Confession Study Apps For those interested in Reformed theology and classical Christian teachings, I’ve developed a series of apps that present foundational texts in a clean, focused reading format: The Belgic Confession Canons of Dort Heidelberg Catechism Westminster Shorter Catechism Each app is designed to provide a distraction-free experience, making it easier to read, reflect, and revisit these im...

How to fix up sendgrid-python, BadRequestsError

Traceback (most recent call last):
  File "sendmail.py", line 79, in <module>
    response = sg.client.mail.send.post(request_body=mail.get())
  File "/home/errong_leng/.local/lib/python2.7/site-packages/python_http_client/client.py", line 227, in http_request
    return Response(self._make_request(opener, request))
  File "/home/errong_leng/.local/lib/python2.7/site-packages/python_http_client/client.py", line 161, in _make_request
    raise exc
python_http_client.exceptions.BadRequestsError

The easy way is to catch this exception and print out the error body:
try:
    response = sg.client.mail.send.post(request_body=mail.get())
    print(response.status_code)
    print(response.body)
    print(response.headers)
except Exception as e:
    print (e.body)  #print (e.read()) 


Then you can know why bad request error reported, such as:
{"errors":[{"message":"Following RFC 1341, section 7.2, if either text/html or text/plain are to be sent in your email: text/plain needs to be first, followed by text/html, followed by any other content.","field":"content","help":null}]}

{"errors":[{"message":"The subject is required. You can get around this requirement if you use a template with a subject defined or if every personalization has a subject defined.","field":"subject","help":"http://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html#message.subject"}]}

{"errors":[{"message":"Each email address in the personalization block should be unique between to, cc, and bcc. We found the first duplicate instance of [errong.leng@gmail.com] in the personalizations.0.to field.","field":"personalizations.0","help":"http://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html#message.recipient-errors"}]}

❤️ Support This Blog


If this post helped you, you can support my writing with a small donation. Thank you for reading.


Comments

Popular Posts

2026 Begins: Choosing to Stay on the Path as a Blogger

A New Collection of Thoughtful Learning Apps — Now Available on iOS & Android