electricitymaps / bloom-contrib

Making carbon footprint data available to everyone.
https://www.bloomclimate.com
MIT License
436 stars 104 forks source link

update tfl request error message handling #311

Closed liamgarrison closed 4 years ago

liamgarrison commented 4 years ago

Fixes #294

corradio commented 4 years ago

Thanks!

On Friday, January 24, 2020, Liam Garrison notifications@github.com wrote:

@liamgarrison commented on this pull request.

In integrations/transportation/tfl.js https://github.com/tmrowco/tmrowapp-contrib/pull/311#discussion_r370636923 :

@@ -10,11 +10,13 @@ async function request(url, opts) { try { const response = await fetch(url, opts); if (!response.ok) {

  • throw new Error(response);
  • // This will be caught by the catch block and recaught
  • throw new Error(response.statusText);

I've simplified it and made it more like the other integrations.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tmrowco/tmrowapp-contrib/pull/311?email_source=notifications&email_token=AAMUIKFZSAYDNZWJS2HOBKTQ7LVOBA5CNFSM4KK34SF2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCS6WNKA#discussion_r370636923, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMUIKCD46R3TM2M2VF6GD3Q7LVOBANCNFSM4KK34SFQ .

--

Olivier Corradi

Founder, CEO

https://www.linkedin.com/in/oliviercorradi https://twitter.com/corradio

tmrow.com