blob: 2d5c2a64038efc354febd7dfa9a305f616820874 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
import { isString } from 'lodash';
import { __ } from '~/locale';
export const UNEXPECTED_ERROR = __('Unexpected error');
export const getErrorMessage = (e) => {
if (!e) {
return UNEXPECTED_ERROR;
}
if (isString(e)) {
return e;
}
return e.message || e.networkError || UNEXPECTED_ERROR;
};
|