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

load_enums: skip bad enum definitions with error message #1384

Merged
merged 2 commits into from
Aug 4, 2023

Conversation

loehnertj
Copy link
Contributor

See Issue #1381 :

Looking beyond the problem at hand, it might always be that a server has unexpected or corrupt data for one or more type definitions. load_type_definitions should skip such definitions with an error message and continue on. This PR provides this behavior for Enum + OptionSet types.

For regular structure types, this should already happen with the code as before (since there are up to 10 retries); however I didn't verify this.

The idea of raising all Exceptions together as ExceptionGroup was discarded for two reasons:

  1. load_type_definitions returns the created objects as list, which is not possible if an Exception is raised;
  2. ExceptionGroup was introduced in Py 3.11, requiring some hack or backport to support earlier versions.

@loehnertj loehnertj changed the title Issue 1381 b load_enums: skip bad enum definitions with error message Aug 2, 2023
@oroulet oroulet merged commit 88c0fc3 into FreeOpcUa:master Aug 4, 2023
5 checks passed
Dimfred pushed a commit to Dimfred/opcua-asyncio that referenced this pull request Sep 19, 2023
)

* load_enums: On unexpected errors, skip entry with error message

* fix test if not run in isolation
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 this pull request may close these issues.

2 participants