File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,6 +41,10 @@ Section Order:
4141### Security
4242-->
4343
44+ ### Changed
45+
46+ - Attempting to catch ESI errors thrown by the OpenAPI client through ` aiopenapi3 ` (See: https://gitlab.com/allianceauth/django-esi/-/issues/40 )
47+
4448## [ 3.0.0-alpha.2] - 2025-09-04
4549
4650> [ !CAUTION]
Original file line number Diff line number Diff line change 22Our Models
33"""
44
5+ # Third Party
6+ from aiopenapi3 import ContentTypeError
7+
58# Django
69from django .db import models
710from django .utils .translation import gettext_lazy as _
@@ -86,10 +89,10 @@ def get_sov_structures_from_esi(cls):
8689 sovereignty_structures_esi = (
8790 esi .client .Sovereignty .GetSovereigntyStructures ().results ()
8891 )
89- except OSError as ex :
92+ except ( OSError , ContentTypeError ) as ex :
9093 logger .info (
9194 msg = (
92- f"Something went wrong while trying to fetch sovereignty structures from ESI: { ex } "
95+ f"Error while trying to fetch sovereignty structures from ESI: { ex } "
9396 )
9497 )
9598 sovereignty_structures_esi = None
@@ -150,10 +153,10 @@ def get_sov_campaigns_from_esi(cls):
150153 sovereignty_campaigns_esi = (
151154 esi .client .Sovereignty .GetSovereigntyCampaigns ().results ()
152155 )
153- except OSError as ex :
156+ except ( OSError , ContentTypeError ) as ex :
154157 logger .info (
155158 msg = (
156- f"Something went wrong while trying to fetch sovereignty campaigns from ESI: { ex } "
159+ f"Error while trying to fetch sovereignty campaigns from ESI: { ex } "
157160 )
158161 )
159162 sovereignty_campaigns_esi = None
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ def update_sov_campaigns() -> None:
9595 )
9696
9797 if not campaigns_from_esi :
98- logger .info (msg = "No sovereignty campaigns found, nothing to update." )
98+ logger .info (msg = "No (new) sovereignty campaigns found, nothing to update." )
9999
100100 return
101101
@@ -171,7 +171,7 @@ def update_sov_structures() -> None:
171171
172172 # If no structures are returned from ESI, we can exit early
173173 if not structures_from_esi :
174- logger .info (msg = "No sovereignty structures found, nothing to update." )
174+ logger .info (msg = "No (new) sovereignty structures found, nothing to update." )
175175
176176 return
177177
You can’t perform that action at this time.
0 commit comments