zowe / zowe/api-layer

Exception handling in Caching Service

Open
#4,426 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

This issue is based on #4408

Almost all exception thrown in the Caching service uses class StorageException. This exception means a state or it is used just to wrap original exception. All the exception are handled in the controller and there is no ControllerAdvice bean. All this complicates the control of program. It is very dificult to decide what error message should be returned. It the PR #4408 is possible to look what is the temporary solution of this issue. Anyway, the aim of this issue is:

  • separate exception handling to a new class (ControllerAdvice)
  • create a structure of exception that allows to easily detect reason of failure
  • review the whole Caching service and caller part in the Gateway on how exception are handled
  • write multiple tests to verify if the proper response code was returned

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 by reviewing the temporary solution in PR #4408 and trace exception handling through the Caching service and its caller in the Gateway. Define the ControllerAdvice and exception structure from the existing behavior, then add tests covering the response codes for the identified failure reasons.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.