Skip to content

Fix falcon-instrumentation _handle_exception method to remove pylint disables#4207

Open
srikaaviya wants to merge 1 commit intoopen-telemetry:mainfrom
srikaaviya:fix/falcon-handle-exception-pylint-4198
Open

Fix falcon-instrumentation _handle_exception method to remove pylint disables#4207
srikaaviya wants to merge 1 commit intoopen-telemetry:mainfrom
srikaaviya:fix/falcon-handle-exception-pylint-4198

Conversation

@srikaaviya
Copy link

Description

The _handle_exception method in the Falcon instrumentation had pylint warnings suppressed with inline disable comments (C0103, W0237, W1114) because a single method definition was trying to handle two different Falcon versions that have
different argument orders.

This change defines _handle_exception conditionally based on the detected Falcon version
at import time:

  • For Falcon 1: _handle_exception(self, ex, req, resp, params) - matching the Falcon 1 base class signature
  • For Falcon 2+: _handle_exception(self, req, resp, ex, params) - matching the Falcon 2+ base class signature

Since each version now uses the correct parameter names in the correct order, all three
pylint warnings are resolved without needing any disable comments.

Fixes #4198

Test:

  • Existing Falcon instrumentation tests pass (35/41 — 6 pre-existing failures unrelated to this change)
  • Pylint runs clean with no C0103, W0237, or W1114 warnings
  • Pre-commit checks (ruff lint + format) pass

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 15, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: srikaaviya / name: srikaaviya (3c99485)

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.

Improve falcon-instrumentation _handle_exception method to remove pylint disables

1 participant