Skip to content

Commit 6268e16

Browse files
committed
1 parent 04957ce commit 6268e16

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

ckanext/push_errors/plugin.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from ckan.plugins import toolkit
77
from ckanext.push_errors.logging import PushErrorHandler, push_message
88
from ckanext.push_errors.cli import push_errors as push_errors_commands
9-
from ckanext.push_errors.error_logger import log_error
109
from ckanext.push_errors.utils import get_error_trace_id
1110

1211
from ckanext.push_errors.blueprints.push_errors import push_error_bp
@@ -45,12 +44,6 @@ def error_handler(exception):
4544
if isinstance(exception, skip_types_if_anon):
4645
return None
4746

48-
# Registrar usando log_error (deduplicación y silenciado)
49-
try:
50-
log_error(exception)
51-
except Exception as log_err:
52-
log.warning(f'push-errors: log_error failed: {log_err}')
53-
5447
exception_str = f'{exception} [({type(exception).__name__})]'
5548
# get the stacktrace
5649
trace = traceback.format_exc()

ckanext/push_errors/tests/test_utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ def test_get_error_trace_id_returns_path_and_line():
2121
raise_custom_error()
2222
except CustomError as e:
2323
trace_id = get_error_trace_id(e)
24-
assert ":" in trace_id
25-
assert not trace_id.endswith(".py") # it only ends with ":<line>"
24+
assert ":" in trace_id, "Trace ID should contain a colon"
25+
path, line = trace_id.rsplit(":", 1)
26+
assert path.endswith("test_utils.py"), f"Expected path to end with test_utils.py, got {path}"
27+
assert line.isdigit(), f"Expected a line number, got {line}"
2628

2729

2830
def test_get_error_trace_id_unknown_when_no_tb():

0 commit comments

Comments
 (0)