1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-07 14:55:27 +02:00

feat(config): separate configmaps and secrets [EE-5078] (#9029)

This commit is contained in:
Ali 2023-06-12 09:46:48 +12:00 committed by GitHub
parent 4a331b71e1
commit d7fc2046d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
102 changed files with 2845 additions and 665 deletions

View file

@ -16,6 +16,12 @@ export function isFulfilled<T>(
return result.status === 'fulfilled';
}
export function isRejected<T>(
result: PromiseSettledResult<T>
): result is PromiseRejectedResult {
return result.status === 'rejected';
}
export function getFulfilledResults<T>(
results: Array<PromiseSettledResult<T>>
) {

View file

@ -127,6 +127,7 @@ export const ngModule = angular
'type',
'value',
'to',
'params',
'children',
'pluralType',
'isLoading',

View file

@ -49,6 +49,13 @@ export function agentInterceptor(config: AxiosRequestConfig) {
axios.interceptors.request.use(agentInterceptor);
/**
* Parses an Axios error and returns a PortainerError.
* @param err The original error.
* @param msg An optional error message to prepend.
* @param parseError A function to parse AxiosErrors. Defaults to defaultErrorParser.
* @returns A PortainerError with the parsed error message and details.
*/
export function parseAxiosError(
err: Error,
msg = '',
@ -70,7 +77,7 @@ export function parseAxiosError(
return new PortainerError(resultMsg, resultErr);
}
function defaultErrorParser(axiosError: AxiosError) {
export function defaultErrorParser(axiosError: AxiosError) {
const message = axiosError.response?.data.message || '';
const details = axiosError.response?.data.details || message;
const error = new Error(message);