USACE / USACE/cwms-data-api

Improve error handling for Lookup Types

Open
#1,894 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
28
Forks
25
Avg merge
4d 22h
Merged PRs (30d)
20

Description

Is your feature request related to a problem? Please describe.
Currently, use of an invalid category or prefix value will result in a response of "Not implemented". This is inaccurate and unhelpful when determining the cause of failure.

To recreate, use any string value for the category and prefix. For a successful response, see the defined category and prefix in the test class: https://github.com/USACE/cwms-data-api/blob/a2be20c1dc064f4b7bb35cae8ca6fd48b487a84e/cwms-data-api/src/test/java/cwms/cda/api/LookupTypeControllerIT.java#L52

Describe the solution you'd like
Clear error messages using the new CDA error message structure should be implemented to clarify when a failure is caused by invalid user input.

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 with cwms-data-api/src/test/java/cwms/cda/api/LookupTypeControllerIT.java around line 52 and inspect the Lookup Types endpoint and existing CDA error message structure. Reproduce invalid category and prefix inputs, then ensure they return clear structured invalid-input errors instead of “Not implemented”; verify valid values still succeed with relevant integration coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.