@equinor/fusion-react-power-bi
Version:
React component for displaying an person information
33 lines • 1.22 kB
JavaScript
import { getType } from 'typesafe-actions';
import { actions } from '../../store/actions';
import { processError } from './process-error';
export const processActionError = ({ error, action }) => {
const code = Number(error.statusCode);
const options = processError(error);
switch (action.type) {
case getType(actions.fetchEmbedInfo.request): {
const title = 'Sorry we could load the Power BI embedding information for the report';
switch (code) {
case 403:
return {
...options,
title,
type: 'accessDenied',
message: 'You do not have access to view the report',
};
case 404:
return {
...options,
title,
type: 'notFound',
message: 'The report does not exist',
};
default:
return { ...options, title };
}
}
}
return options;
};
export default processActionError;
//# sourceMappingURL=process-action-error.js.map