Skip to content

Commit a07debe

Browse files
Add exception raise for bad gateway (#15)
* Add exception raise for bad gateway * Move the exception
1 parent a320a9f commit a07debe

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

forecast_solar/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ async def _request(
101101
ssl=False,
102102
)
103103

104+
if response.status == 502:
105+
raise ForecastSolarConnectionError(
106+
"The Forecast.Solar API is unreachable, "
107+
)
108+
104109
if response.status < 500:
105110
self.ratelimit = Ratelimit.from_response(response)
106111

0 commit comments

Comments
 (0)