Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider more specific exceptions than osmapi.OsmApi.ApiError #115

Closed
matkoniecz opened this issue Sep 22, 2021 · 4 comments · Fixed by #118
Closed

Consider more specific exceptions than osmapi.OsmApi.ApiError #115

matkoniecz opened this issue Sep 22, 2021 · 4 comments · Fixed by #118

Comments

@matkoniecz
Copy link
Contributor

osmapi.OsmApi.ApiError: Request failed: 409 - Conflict - b'The changeset 111530865 was closed at 2021-09-22 09:42:47 UTC'

I would like to catch just "adding to closed changeset" errors and it seems that it will require error prone parsing of strings. Is there a better way to do this?

@matkoniecz
Copy link
Contributor Author

Wait, it seems that it should be covered by #38

@metaodi
Copy link
Owner

metaodi commented Sep 30, 2021

@matkoniecz so is this resolved or do you suggest other exceptions?

@matkoniecz
Copy link
Contributor Author

I am using osmapi 1.3.0 that includes #38 and I get exceptions such as osmapi.OsmApi.ApiError: Request failed: 409 - Conflict - b'The changeset 111530865 was closed at 2021-09-22 09:42:47 UTC'

So it is still needed. While #38 added osmapi.NoChangesetOpenError it seems to be used when there is no changeset open at all, not when there is attempt to add to an already closed changeset.

So yes, I am proposing osmapi.ChangesetAlreadyClosedError (maybe make it subtype of osmapi.OsmApi? as I understand it would preserve backward compatibility)

@metaodi
Copy link
Owner

metaodi commented Sep 30, 2021

Ok got it, thanks for reporting this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants