HydrologicEngineeringCenter / HydrologicEngineeringCenter/cwms-python

No error raised on multithreaded store failure

Open
#277 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
16
Forks
11
Avg merge
4d 6h
Merged PRs (30d)
8

Description

If using multithreaded store_timeseries, there's no way to determine if there was an error.

The ApiError exception used in the single chunk case is not raised in the multithreaded case.

I don't necessarily need to know what the specific error(s) are, but I'd like to know if there was any error that occurred. The only way to know that currently is to look at the log.

Example log entries I've seen:

2026-03-20 13:21:38,321 - ERROR - Error storing chunk from 1569803400000 to 1569888900000: Object of type function is not JSON serializable
...
2026-03-20 13:21:46,873 - ERROR - CDA Error: response=<Response [400]>
2026-03-20 13:21:46,876 - ERROR - Error storing chunk from 1569803400000 to 1569888900000: CWMS API Error (https://wm.spk.ds.usace.army.mil/spk-data/timeseries?create-as-lrts=False&store-rule=Do+Not+Replace&override-protection=False) 400. Check that your parameters are correct. Bad Request

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the multithreaded store_timeseries entry point and compare its error handling with the single-chunk path that raises ApiError. Exercise the multithreaded path using the failure cases shown in the logs and verify that callers can detect when any chunk failed, rather than needing to inspect logs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.