mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-28 10:33:02 -05:00
Add a handler for AxiosError errors (#189)
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { isAxiosError } from 'axios';
|
||||
import express from 'express';
|
||||
import path from 'path';
|
||||
import { inspect } from 'util';
|
||||
|
||||
import { nordigenService } from './services/nordigen-service.js';
|
||||
import {
|
||||
@@ -193,14 +195,24 @@ app.post(
|
||||
});
|
||||
break;
|
||||
case error instanceof GenericNordigenError:
|
||||
console.log({ message: 'Something went wrong', error });
|
||||
console.log('Something went wrong', inspect(error, { depth: null }));
|
||||
sendErrorResponse({
|
||||
error_type: 'SYNC_ERROR',
|
||||
error_code: 'NORDIGEN_ERROR',
|
||||
});
|
||||
break;
|
||||
case isAxiosError(error):
|
||||
console.log(
|
||||
'Something went wrong',
|
||||
inspect(error.response.data, { depth: null }),
|
||||
);
|
||||
sendErrorResponse({
|
||||
error_type: 'SYNC_ERROR',
|
||||
error_code: 'NORDIGEN_ERROR',
|
||||
});
|
||||
break;
|
||||
default:
|
||||
console.log({ message: 'Something went wrong', error });
|
||||
console.log('Something went wrong', inspect(error, { depth: null }));
|
||||
sendErrorResponse({
|
||||
error_type: 'UNKNOWN',
|
||||
error_code: 'UNKNOWN',
|
||||
|
||||
6
upcoming-release-notes/189.md
Normal file
6
upcoming-release-notes/189.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Enhancements
|
||||
authors: [j-f1]
|
||||
---
|
||||
|
||||
More clearly report the problem with Nordigen requests that fail with an unexpected status code
|
||||
Reference in New Issue
Block a user