Skip to content

Commit b3d231d

Browse files
committed
add raise_exc method to Success
so we can cut some of the boilerplate by just calling raise_exc, ensuring that the response was successful in following lines and get an useful error message otherwise.
1 parent 5dad62b commit b3d231d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/mahou/templates/aiohttp_client.py.jinja

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ class Success[TCode, TSuccess]:
3535
code: TCode
3636
result: TSuccess
3737

38+
def raise_exc(self) -> None:
39+
pass
40+
3841

3942
@dataclass(slots=True)
4043
class Error[TCode, TError]:

0 commit comments

Comments
 (0)