zowe / zowe/api-layer

Fix 400 return code on SAF errors

Open
#3,950 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Priority: Medium size/S V3
Dominant language
Java
Stars
92
Forks
81
Avg merge
1d 9h
Merged PRs (30d)
46

Description

Describe the bug
This is a complementary issue to https://github.com/zowe/api-layer/issues/3007

There is the mapping between SAF errors and http return codes with one specific handling for error 8/16/28 mapped to 400. It is the only one SAF error with distinguished return code with seemingly no specific reason. I suggest to unify the error mapping to 500.

https://github.com/zowe/api-layer/blob/32793d87d6c10d15ff8a8ef1fb5213b91ec87bee/common-service-core/src/main/java/org/zowe/apiml/passticket/AbstractIRRPassTicketException.java#L65

Expected behavior
Return 500 as for the other SAF error messages as 400 should indicate malformed request rather than permissions issue

Details

  • Version and build number: v3, v2

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 common-service-core/src/main/java/org/zowe/apiml/passticket/AbstractIRRPassTicketException.java around line 65 and inspect the SAF error-to-HTTP status mapping, especially errors 8, 16, and 28. Done means those SAF errors return HTTP 500 consistently with the other SAF errors rather than HTTP 400.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.