• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

FlexMeasures / flexmeasures / 42018758001
88%

Build:
DEFAULT BRANCH: main
Ran 05 Nov 2026 11:35AM UTC
Jobs 1
Files 195
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

05 Nov 2026 11:24AM UTC coverage: 87.723% (-0.004%) from 87.727%
42018758001

push

github

web-flow
Answer unknown /api URLs with a JSON 404 (#2618)

* Answer unknown /api URLs with a JSON 404

error_handling_router decided between JSON and HTML by looking at the
matched URL rule, which is None when no route matched, so an unknown URL
under /api fell through to the HTML error page unless the request itself
carried a JSON content type. Decide on the request path instead, so every
error under /api is answered in JSON.

Adds tests on a bare Flask app with only the generic error handler, and
entries in the API change log and the changelog.

Closes #2598

Signed-off-by: Sajal Kumar Jana <kakalijana1254@gmail.com>

* Fill in PR number in changelog

Signed-off-by: Sajal Kumar Jana <kakalijana1254@gmail.com>

* Fix HTML fallback handler name in error routing test

error_handling_router looks up an HTML handler named after the error's
class, which for a 404 is NotFound, so the test fixture has to set
NotFound_handler_html. Under the old name the handler was never used and
the HTML assertion only held because of the plain-text fallback, so the
test now also checks that the response body comes from the handler.

Also re-wrap the docstring of error_handling_router so lines only break
after punctuation.

Signed-off-by: Sajal Kumar Jana <kakalijana1254@gmail.com>

* tests: a wrong method on an API route gets a JSON 405

Such a request matches no route either, so it used to get the HTML error page, too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DWv6v5ELzmj2eBM1L4GTBz
Signed-off-by: F.N. Claessen <claessen@seita.nl>

* utils/error_utils: answer in JSON only under /api itself, not /apiary

A plain prefix check also matched paths that merely start with "api".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DWv6v5ELzmj2eBM1L4GTBz
Signed-off-by: F.N. Claessen <claessen@seita.nl>

---------

Signed-off-by: F.N. Claessen <claessen@seita.nl>
Co-authore... (continued)

23130 of 26367 relevant lines covered (87.72%)

0.88 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
78.69
-1.64% flexmeasures/utils/error_utils.py
Jobs
ID Job ID Ran Files Coverage
1 42018758001.1 05 Nov 2026 11:35AM UTC 195
87.72
GitHub Action Run
Source Files on build 42018758001
  • Tree
  • List 195
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #42018758001
  • b17dbe58 on github
  • Prev Build on main (#42008753862)
  • Next Build on main (#42025884111)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc