Skip to content

Commit

Permalink
Add console logging che-server exception messages (#913)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinokurig authored Sep 8, 2023
1 parent b029795 commit f0ef08e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/dashboard-frontend/src/store/SanityCheck/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import { Action, Reducer } from 'redux';
import { AppThunk } from '..';
import { helpers } from '@eclipse-che/common';
import { container } from '../../inversify.config';
import { getDefer } from '../../services/helpers/deferred';
import { delay } from '../../services/helpers/delay';
Expand Down Expand Up @@ -118,6 +119,14 @@ export const actionCreators: ActionCreators = {
type: Type.RECEIVED_BACKEND_CHECK_ERROR,
error: errorMessage,
});
console.error(helpers.errors.getMessage(e));
if (
helpers.errors.includesAxiosResponse(e) &&
e.response.data.trace &&
Array.isArray(e.response.data.trace)
) {
console.error(e.response.data.trace.join('\n'));
}
throw new Error(errorMessage);
}
},
Expand Down

0 comments on commit f0ef08e

Please sign in to comment.