refactor: Refactored middlewares to use RequestError

Refactored middlewares to use RequestError rather than using
`try {...}catch (err){...}`. With this change it's possible to manage
all error details within one place.

Added:
- Added Sentry.captureException to Error Handler
This commit is contained in:
Hüseyin Berke Bütün
2022-12-22 01:42:02 +01:00
parent bd9041a62c
commit 6f5d7a831b
13 changed files with 156 additions and 199 deletions
+1
View File
@@ -53,6 +53,7 @@ const exchangeRefreshHeroku = async ({
refreshToken: string;
}) => {
let accessToken;
//TODO: Refactor code to take advantage of using RequestError. It's possible to create new types of errors for more detailed errors
try {
const res = await axios.post(
INTEGRATION_HEROKU_TOKEN_URL,