Skip to content

Commit

Permalink
Merge pull request #4 from jsenecal/develop
Browse files Browse the repository at this point in the history
Handle more error codes
  • Loading branch information
jsenecal authored Mar 7, 2023
2 parents 12997d8 + c3f98a0 commit dc852e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyregrws"
version = "0.1.3"
version = "0.1.4"
description = "Python library to retrieve and modify records within ARIN's database through their Reg-RWS service"
authors = ["Jonathan Senecal <[email protected]>"]
homepage = "https://github.com/jsenecal/pyregrws"
Expand Down
4 changes: 3 additions & 1 deletion regrws/api/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ def _do(
from regrws.api.core import Session
from regrws.models import Error

with Session({200: return_type or self.model, 400: Error, 404: Error}) as session:
handlers = {200: return_type or self.model}
handlers.update({i: Error for i in [400, 401, 403, 404, 405, 406, 409]})
with Session(handlers) as session: # type: ignore
session_method = getattr(session, verb)
res: Response = session_method(
url, params=self.url_params, data=data
Expand Down

0 comments on commit dc852e2

Please sign in to comment.