explicit raise from
This commit is contained in:
parent
c718d4d142
commit
63bfee71bf
@ -81,8 +81,8 @@ class V6D0AuthAppFactory(AppFactory):
|
||||
async def pull(request: web.Request):
|
||||
try:
|
||||
pulled = await pulled_for_request(request)
|
||||
except KeyError:
|
||||
raise web.HTTPNotFound
|
||||
except KeyError as e:
|
||||
raise web.HTTPNotFound from e
|
||||
else:
|
||||
return web.Response(body=pulled)
|
||||
|
||||
|
@ -3,7 +3,7 @@ from nacl.exceptions import BadSignatureError
|
||||
from nacl.signing import VerifyKey
|
||||
|
||||
from v6d0auth import certs
|
||||
from v6d0auth.config import myroot, caurl
|
||||
from v6d0auth.config import caurl, myroot
|
||||
|
||||
__all__ = ('request_signature', 'mycert', 'has_role', 'request_role', 'with_role',)
|
||||
|
||||
@ -17,8 +17,8 @@ async def request_signature() -> bytes:
|
||||
await ws.send_bytes(certs.vkey.encode())
|
||||
try:
|
||||
return await ws.receive_bytes()
|
||||
except TypeError:
|
||||
raise RuntimeError("signature request failed")
|
||||
except TypeError as e:
|
||||
raise RuntimeError("signature request failed") from e
|
||||
|
||||
|
||||
_certfile = myroot / 'cert'
|
||||
@ -49,8 +49,8 @@ async def request_role(role: str) -> bytes:
|
||||
await ws.send_bytes(certs.vkey.encode())
|
||||
try:
|
||||
return await ws.receive_bytes()
|
||||
except TypeError:
|
||||
raise RuntimeError("role request failed")
|
||||
except TypeError as e:
|
||||
raise RuntimeError("role request failed") from e
|
||||
|
||||
|
||||
async def with_role(role: str):
|
||||
|
Loading…
Reference in New Issue
Block a user