Decathlon / Decathlon/ara

Handle errors on API calls

Open
#291 0 comments 0 reactions 0 assignees View on GitHub
Technical Enhancement
Dominant language
Java
Stars
80
Forks
17
PR merge metrics
No merged PRs in 30d

Description

**What it's the actual situation on ARA ?**
Every time an API is called, a function that handle the error is also called (`api.handleError(error)`).
Although this works, there are a few disadvantages:
- This is extra work
- This is redundant code
- If a new behavior is required, you need to update all the api calls
- You can forget to add it
- It is not a good practice

**Describe the solution you'd like**
An interceptor is a good solution.

> **IMPORTANT**: Don't forget to delete all the function (`api.handleError(error)`) calls when catching the error

Contributor guide

No contributing guide indexed for this repository

Research direction

No files or tests are named. Start by locating the API call sites and every api.handleError(error) reference, then read how the existing error handling works; done means error handling is centralized through an interceptor and the redundant calls are removed without regressions.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.