Skip to content

Commit

Permalink
Do not wrap factory resolver rquest exception
Browse files Browse the repository at this point in the history
Signed-off-by: Igor <ivinokur@redhat.com>
  • Loading branch information
vinokurig committed Sep 18, 2023
1 parent 5b65006 commit fc1ad28
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/

import axios from 'axios';
import { helpers } from '@eclipse-che/common';
import { cheServerPrefix } from './const';
import { FactoryResolver } from '../helpers/types';

Expand All @@ -21,14 +20,10 @@ export async function getFactoryResolver(
url: string,
overrideParams: { [params: string]: string } = {},
): Promise<FactoryResolver> {
try {
const response = await axios.post(
`${cheServerPrefix}${factoryResolverEndpoint}`,
Object.assign({}, overrideParams, { url }),
);
const response = await axios.post(
`${cheServerPrefix}${factoryResolverEndpoint}`,
Object.assign({}, overrideParams, { url }),
);

return response.data;
} catch (e) {
throw new Error(`Failed to fetch factory resolver'. ${helpers.errors.getMessage(e)}`);
}
return response.data;
}

0 comments on commit fc1ad28

Please sign in to comment.