Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass INVALID_OFFICE_ID through on errors #943

Closed
krowvin opened this issue Nov 7, 2024 · 1 comment · Fixed by #947
Closed

Pass INVALID_OFFICE_ID through on errors #943

krowvin opened this issue Nov 7, 2024 · 1 comment · Fixed by #947
Assignees
Labels
approved-W192HQ23F0232-task4 Only valid if set by MikeNeilson, DanielO, CharlesG

Comments

@krowvin
Copy link
Collaborator

krowvin commented Nov 7, 2024

If a user does this
https://cwms-data.usace.army.mil/cwms-data/timeseries?name=OMA.Temp-Water.Inst.1Hour.0.Best-NWDM&office=NWDW&unit=EN

They get this error

{"message":"System Error","incidentIdentifier":"-897878052613553257","details":{}}

Which is very cryptic.

In the actual logs I see this:

Msg = ORA-20010: INVALID_OFFICE_ID: "NWDW" is not a valid CWMS office id

The correct URL / OFFICE would be
https://cwms-data.usace.army.mil/cwms-data/timeseries?name=OMA.Temp-Water.Inst.1Hour.0.Best-NWDM&office=NWDM&unit=EN

I.e. NWDM not NWDW - it's a mistake I made and another user made as well.

This could be said for other errors, but i'll just pop in as we find them!

Solution

A vague

{"error": "Invalid office id: <office-id>"}

is more helpful!

@MikeNeilson
Copy link
Contributor

If the returned value is included it must be passed through the sanitizer. However, I do think it would be good to include, sometime you need the error message AND text for your brain to finally read the letters correctly.

@krowvin krowvin added the approved-W192HQ23F0232-task4 Only valid if set by MikeNeilson, DanielO, CharlesG label Nov 7, 2024
@adamkorynta adamkorynta linked a pull request Nov 11, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved-W192HQ23F0232-task4 Only valid if set by MikeNeilson, DanielO, CharlesG
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants