mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-01-19 03:05:53 +08:00
Improve network error handling
This commit is contained in:
parent
1bee405599
commit
a6498ca729
@ -1,5 +1,6 @@
|
|||||||
import { Dispatch } from "redux";
|
import { Dispatch } from "redux";
|
||||||
import { listQueueStats, ListQueueStatsResponse } from "../api";
|
import { listQueueStats, ListQueueStatsResponse } from "../api";
|
||||||
|
import { toErrorString, toErrorStringWithHttpStatus } from "../utils";
|
||||||
|
|
||||||
export const LIST_QUEUE_STATS_BEGIN = "LIST_QUEUE_STATS_BEGIN";
|
export const LIST_QUEUE_STATS_BEGIN = "LIST_QUEUE_STATS_BEGIN";
|
||||||
export const LIST_QUEUE_STATS_SUCCESS = "LIST_QUEUE_STATS_SUCCESS";
|
export const LIST_QUEUE_STATS_SUCCESS = "LIST_QUEUE_STATS_SUCCESS";
|
||||||
@ -35,10 +36,13 @@ export function listQueueStatsAsync() {
|
|||||||
payload: response,
|
payload: response,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("listQueueStatsAsync: ", error);
|
console.error(
|
||||||
|
"listQueueStatsAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: LIST_QUEUE_STATS_ERROR,
|
type: LIST_QUEUE_STATS_ERROR,
|
||||||
error: "Could not fetch queue stats",
|
error: toErrorString(error),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -6,7 +6,7 @@ import {
|
|||||||
pauseQueue,
|
pauseQueue,
|
||||||
resumeQueue,
|
resumeQueue,
|
||||||
} from "../api";
|
} from "../api";
|
||||||
import { toErrorString } from "../utils";
|
import { toErrorString, toErrorStringWithHttpStatus } from "../utils";
|
||||||
|
|
||||||
// List of queue related action types.
|
// List of queue related action types.
|
||||||
export const LIST_QUEUES_BEGIN = "LIST_QUEUES_BEGIN";
|
export const LIST_QUEUES_BEGIN = "LIST_QUEUES_BEGIN";
|
||||||
@ -109,10 +109,10 @@ export function listQueuesAsync() {
|
|||||||
payload: response,
|
payload: response,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`listQueuesAsync: ${toErrorString(error)}`);
|
console.error(`listQueuesAsync: ${toErrorStringWithHttpStatus(error)}`);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: LIST_QUEUES_ERROR,
|
type: LIST_QUEUES_ERROR,
|
||||||
error: error.response.data,
|
error: toErrorString(error),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -136,7 +136,7 @@ export function deleteQueueAsync(qname: string) {
|
|||||||
dispatch({
|
dispatch({
|
||||||
type: DELETE_QUEUE_ERROR,
|
type: DELETE_QUEUE_ERROR,
|
||||||
queue: qname,
|
queue: qname,
|
||||||
error: `Could not delete queue: ${qname}`,
|
error: toErrorString(error),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -148,11 +148,12 @@ export function pauseQueueAsync(qname: string) {
|
|||||||
try {
|
try {
|
||||||
await pauseQueue(qname);
|
await pauseQueue(qname);
|
||||||
dispatch({ type: PAUSE_QUEUE_SUCCESS, queue: qname });
|
dispatch({ type: PAUSE_QUEUE_SUCCESS, queue: qname });
|
||||||
} catch {
|
} catch (error) {
|
||||||
|
console.error("pauseQueueAsynq: ", toErrorStringWithHttpStatus(error));
|
||||||
dispatch({
|
dispatch({
|
||||||
type: PAUSE_QUEUE_ERROR,
|
type: PAUSE_QUEUE_ERROR,
|
||||||
queue: qname,
|
queue: qname,
|
||||||
error: `Could not pause queue: ${qname}`,
|
error: toErrorString(error),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -164,11 +165,12 @@ export function resumeQueueAsync(qname: string) {
|
|||||||
try {
|
try {
|
||||||
await resumeQueue(qname);
|
await resumeQueue(qname);
|
||||||
dispatch({ type: RESUME_QUEUE_SUCCESS, queue: qname });
|
dispatch({ type: RESUME_QUEUE_SUCCESS, queue: qname });
|
||||||
} catch {
|
} catch (error) {
|
||||||
|
console.error("resumeQueueAsync: ", toErrorStringWithHttpStatus(error));
|
||||||
dispatch({
|
dispatch({
|
||||||
type: RESUME_QUEUE_ERROR,
|
type: RESUME_QUEUE_ERROR,
|
||||||
queue: qname,
|
queue: qname,
|
||||||
error: `Could not resume queue: ${qname}`,
|
error: toErrorString(error),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Dispatch } from "redux";
|
import { Dispatch } from "redux";
|
||||||
import { getRedisInfo, RedisInfoResponse } from "../api";
|
import { getRedisInfo, RedisInfoResponse } from "../api";
|
||||||
import { toErrorString } from "../utils";
|
import { toErrorString, toErrorStringWithHttpStatus } from "../utils";
|
||||||
|
|
||||||
// List of redis-info related action types.
|
// List of redis-info related action types.
|
||||||
export const GET_REDIS_INFO_BEGIN = "GET_REDIS_INFO_BEGIN";
|
export const GET_REDIS_INFO_BEGIN = "GET_REDIS_INFO_BEGIN";
|
||||||
@ -34,10 +34,10 @@ export function getRedisInfoAsync() {
|
|||||||
const response = await getRedisInfo();
|
const response = await getRedisInfo();
|
||||||
dispatch({ type: GET_REDIS_INFO_SUCCESS, payload: response });
|
dispatch({ type: GET_REDIS_INFO_SUCCESS, payload: response });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`getRedisInfoAsync: ${toErrorString(error)}`);
|
console.error(`getRedisInfoAsync: ${toErrorStringWithHttpStatus(error)}`);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: GET_REDIS_INFO_ERROR,
|
type: GET_REDIS_INFO_ERROR,
|
||||||
error: error.response.data,
|
error: toErrorString(error),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -5,7 +5,7 @@ import {
|
|||||||
listSchedulerEntries,
|
listSchedulerEntries,
|
||||||
ListSchedulerEntriesResponse,
|
ListSchedulerEntriesResponse,
|
||||||
} from "../api";
|
} from "../api";
|
||||||
import { toErrorString } from "../utils";
|
import { toErrorString, toErrorStringWithHttpStatus } from "../utils";
|
||||||
|
|
||||||
// List of scheduler-entry related action types.
|
// List of scheduler-entry related action types.
|
||||||
export const LIST_SCHEDULER_ENTRIES_BEGIN = "LIST_SCHEDULER_ENTRIES_BEGIN";
|
export const LIST_SCHEDULER_ENTRIES_BEGIN = "LIST_SCHEDULER_ENTRIES_BEGIN";
|
||||||
@ -68,10 +68,12 @@ export function listSchedulerEntriesAsync() {
|
|||||||
payload: response,
|
payload: response,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`listSchedulerEnqueueEventsAsync: ${toErrorString(error)}`);
|
console.error(
|
||||||
|
`listSchedulerEnqueueEventsAsync: ${toErrorStringWithHttpStatus(error)}`
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: LIST_SCHEDULER_ENTRIES_ERROR,
|
type: LIST_SCHEDULER_ENTRIES_ERROR,
|
||||||
error: error.response.data,
|
error: toErrorString(error),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -88,10 +90,13 @@ export function listSchedulerEnqueueEventsAsync(entryId: string) {
|
|||||||
entryId,
|
entryId,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("listSchedulerEnqueueEventsAsync: ", error);
|
console.error(
|
||||||
|
"listSchedulerEnqueueEventsAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: LIST_SCHEDULER_ENQUEUE_EVENTS_ERROR,
|
type: LIST_SCHEDULER_ENQUEUE_EVENTS_ERROR,
|
||||||
error: `Could not get enqueue events for entry: ${entryId}`,
|
error: toErrorString(error),
|
||||||
entryId,
|
entryId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Dispatch } from "redux";
|
import { Dispatch } from "redux";
|
||||||
import { listServers, ListServersResponse } from "../api";
|
import { listServers, ListServersResponse } from "../api";
|
||||||
import { toErrorString } from "../utils";
|
import { toErrorString, toErrorStringWithHttpStatus } from "../utils";
|
||||||
|
|
||||||
// List of server related action types.
|
// List of server related action types.
|
||||||
export const LIST_SERVERS_BEGIN = "LIST_SERVERS_BEGIN";
|
export const LIST_SERVERS_BEGIN = "LIST_SERVERS_BEGIN";
|
||||||
@ -35,10 +35,10 @@ export function listServersAsync() {
|
|||||||
payload: response,
|
payload: response,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`listServersAsync: ${toErrorString(error)}`);
|
console.error(`listServersAsync: ${toErrorStringWithHttpStatus(error)}`);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: LIST_SERVERS_ERROR,
|
type: LIST_SERVERS_ERROR,
|
||||||
error: error.response.data,
|
error: toErrorString(error),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -49,6 +49,7 @@ import {
|
|||||||
archiveAllPendingTasks,
|
archiveAllPendingTasks,
|
||||||
} from "../api";
|
} from "../api";
|
||||||
import { Dispatch } from "redux";
|
import { Dispatch } from "redux";
|
||||||
|
import { toErrorString, toErrorStringWithHttpStatus } from "../utils";
|
||||||
|
|
||||||
// List of tasks related action types.
|
// List of tasks related action types.
|
||||||
export const LIST_ACTIVE_TASKS_BEGIN = "LIST_ACTIVE_TASKS_BEGIN";
|
export const LIST_ACTIVE_TASKS_BEGIN = "LIST_ACTIVE_TASKS_BEGIN";
|
||||||
@ -1017,11 +1018,15 @@ export function listActiveTasksAsync(
|
|||||||
queue: qname,
|
queue: qname,
|
||||||
payload: response,
|
payload: response,
|
||||||
});
|
});
|
||||||
} catch {
|
} catch (error) {
|
||||||
|
console.error(
|
||||||
|
"listActiveTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: LIST_ACTIVE_TASKS_ERROR,
|
type: LIST_ACTIVE_TASKS_ERROR,
|
||||||
queue: qname,
|
queue: qname,
|
||||||
error: `Could not retreive active tasks data for queue: ${qname}`,
|
error: toErrorString(error),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1040,11 +1045,15 @@ export function listPendingTasksAsync(
|
|||||||
queue: qname,
|
queue: qname,
|
||||||
payload: response,
|
payload: response,
|
||||||
});
|
});
|
||||||
} catch {
|
} catch (error) {
|
||||||
|
console.error(
|
||||||
|
"listPendingTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: LIST_PENDING_TASKS_ERROR,
|
type: LIST_PENDING_TASKS_ERROR,
|
||||||
queue: qname,
|
queue: qname,
|
||||||
error: `Could not retreive pending tasks data for queue: ${qname}`,
|
error: toErrorString(error),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1063,11 +1072,15 @@ export function listScheduledTasksAsync(
|
|||||||
queue: qname,
|
queue: qname,
|
||||||
payload: response,
|
payload: response,
|
||||||
});
|
});
|
||||||
} catch {
|
} catch (error) {
|
||||||
|
console.error(
|
||||||
|
"listScheduledTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: LIST_SCHEDULED_TASKS_ERROR,
|
type: LIST_SCHEDULED_TASKS_ERROR,
|
||||||
queue: qname,
|
queue: qname,
|
||||||
error: `Could not retreive scheduled tasks data for queue: ${qname}`,
|
error: toErrorString(error),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1086,11 +1099,15 @@ export function listRetryTasksAsync(
|
|||||||
queue: qname,
|
queue: qname,
|
||||||
payload: response,
|
payload: response,
|
||||||
});
|
});
|
||||||
} catch {
|
} catch (error) {
|
||||||
|
console.error(
|
||||||
|
"listRetryTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: LIST_RETRY_TASKS_ERROR,
|
type: LIST_RETRY_TASKS_ERROR,
|
||||||
queue: qname,
|
queue: qname,
|
||||||
error: `Could not retreive retry tasks data for queue: ${qname}`,
|
error: toErrorString(error),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1109,11 +1126,15 @@ export function listArchivedTasksAsync(
|
|||||||
queue: qname,
|
queue: qname,
|
||||||
payload: response,
|
payload: response,
|
||||||
});
|
});
|
||||||
} catch {
|
} catch (error) {
|
||||||
|
console.error(
|
||||||
|
"listArchivedTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: LIST_ARCHIVED_TASKS_ERROR,
|
type: LIST_ARCHIVED_TASKS_ERROR,
|
||||||
queue: qname,
|
queue: qname,
|
||||||
error: `Could not retreive archived tasks data for queue: ${qname}`,
|
error: toErrorString(error),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1125,10 +1146,14 @@ export function cancelActiveTaskAsync(queue: string, taskId: string) {
|
|||||||
try {
|
try {
|
||||||
await cancelActiveTask(queue, taskId);
|
await cancelActiveTask(queue, taskId);
|
||||||
dispatch({ type: CANCEL_ACTIVE_TASK_SUCCESS, queue, taskId });
|
dispatch({ type: CANCEL_ACTIVE_TASK_SUCCESS, queue, taskId });
|
||||||
} catch {
|
} catch (error) {
|
||||||
|
console.error(
|
||||||
|
"cancelActiveTaskAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: CANCEL_ACTIVE_TASK_ERROR,
|
type: CANCEL_ACTIVE_TASK_ERROR,
|
||||||
error: `Could not cancel task: ${taskId}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskId,
|
taskId,
|
||||||
});
|
});
|
||||||
@ -1143,10 +1168,13 @@ export function cancelAllActiveTasksAsync(queue: string) {
|
|||||||
await cancelAllActiveTasks(queue);
|
await cancelAllActiveTasks(queue);
|
||||||
dispatch({ type: CANCEL_ALL_ACTIVE_TASKS_SUCCESS, queue });
|
dispatch({ type: CANCEL_ALL_ACTIVE_TASKS_SUCCESS, queue });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("cancelAllActiveTasksAsync: ", error);
|
console.error(
|
||||||
|
"cancelAllActiveTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: CANCEL_ALL_ACTIVE_TASKS_ERROR,
|
type: CANCEL_ALL_ACTIVE_TASKS_ERROR,
|
||||||
error: "Could not cancel all tasks",
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1164,10 +1192,13 @@ export function batchCancelActiveTasksAsync(queue: string, taskIds: string[]) {
|
|||||||
payload: response,
|
payload: response,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("batchCancelActiveTasksAsync: ", error);
|
console.error(
|
||||||
|
"batchCancelActiveTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BATCH_CANCEL_ACTIVE_TASKS_ERROR,
|
type: BATCH_CANCEL_ACTIVE_TASKS_ERROR,
|
||||||
error: `Could not batch cancel tasks: ${taskIds}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskIds,
|
taskIds,
|
||||||
});
|
});
|
||||||
@ -1182,10 +1213,13 @@ export function runScheduledTaskAsync(queue: string, taskKey: string) {
|
|||||||
await runScheduledTask(queue, taskKey);
|
await runScheduledTask(queue, taskKey);
|
||||||
dispatch({ type: RUN_SCHEDULED_TASK_SUCCESS, queue, taskKey });
|
dispatch({ type: RUN_SCHEDULED_TASK_SUCCESS, queue, taskKey });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("runScheduledTaskAsync: ", error);
|
console.error(
|
||||||
|
"runScheduledTaskAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: RUN_SCHEDULED_TASK_ERROR,
|
type: RUN_SCHEDULED_TASK_ERROR,
|
||||||
error: `Could not run task: ${taskKey}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKey,
|
taskKey,
|
||||||
});
|
});
|
||||||
@ -1200,10 +1234,10 @@ export function runRetryTaskAsync(queue: string, taskKey: string) {
|
|||||||
await runRetryTask(queue, taskKey);
|
await runRetryTask(queue, taskKey);
|
||||||
dispatch({ type: RUN_RETRY_TASK_SUCCESS, queue, taskKey });
|
dispatch({ type: RUN_RETRY_TASK_SUCCESS, queue, taskKey });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("runRetryTaskAsync: ", error);
|
console.error("runRetryTaskAsync: ", toErrorStringWithHttpStatus(error));
|
||||||
dispatch({
|
dispatch({
|
||||||
type: RUN_RETRY_TASK_ERROR,
|
type: RUN_RETRY_TASK_ERROR,
|
||||||
error: `Could not run task: ${taskKey}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKey,
|
taskKey,
|
||||||
});
|
});
|
||||||
@ -1218,10 +1252,13 @@ export function archivePendingTaskAsync(queue: string, taskKey: string) {
|
|||||||
await archivePendingTask(queue, taskKey);
|
await archivePendingTask(queue, taskKey);
|
||||||
dispatch({ type: ARCHIVE_PENDING_TASK_SUCCESS, queue, taskKey });
|
dispatch({ type: ARCHIVE_PENDING_TASK_SUCCESS, queue, taskKey });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("archivePendingTaskAsync: ", error);
|
console.error(
|
||||||
|
"archivePendingTaskAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ARCHIVE_PENDING_TASK_ERROR,
|
type: ARCHIVE_PENDING_TASK_ERROR,
|
||||||
error: `Could not archive task: ${taskKey}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKey,
|
taskKey,
|
||||||
});
|
});
|
||||||
@ -1236,10 +1273,13 @@ export function archiveScheduledTaskAsync(queue: string, taskKey: string) {
|
|||||||
await archiveScheduledTask(queue, taskKey);
|
await archiveScheduledTask(queue, taskKey);
|
||||||
dispatch({ type: ARCHIVE_SCHEDULED_TASK_SUCCESS, queue, taskKey });
|
dispatch({ type: ARCHIVE_SCHEDULED_TASK_SUCCESS, queue, taskKey });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("archiveScheduledTaskAsync: ", error);
|
console.error(
|
||||||
|
"archiveScheduledTaskAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ARCHIVE_SCHEDULED_TASK_ERROR,
|
type: ARCHIVE_SCHEDULED_TASK_ERROR,
|
||||||
error: `Could not archive task: ${taskKey}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKey,
|
taskKey,
|
||||||
});
|
});
|
||||||
@ -1254,10 +1294,13 @@ export function archiveRetryTaskAsync(queue: string, taskKey: string) {
|
|||||||
await archiveRetryTask(queue, taskKey);
|
await archiveRetryTask(queue, taskKey);
|
||||||
dispatch({ type: ARCHIVE_RETRY_TASK_SUCCESS, queue, taskKey });
|
dispatch({ type: ARCHIVE_RETRY_TASK_SUCCESS, queue, taskKey });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("archiveRetryTaskAsync: ", error);
|
console.error(
|
||||||
|
"archiveRetryTaskAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ARCHIVE_RETRY_TASK_ERROR,
|
type: ARCHIVE_RETRY_TASK_ERROR,
|
||||||
error: `Could not archive task: ${taskKey}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKey,
|
taskKey,
|
||||||
});
|
});
|
||||||
@ -1272,10 +1315,13 @@ export function runArchivedTaskAsync(queue: string, taskKey: string) {
|
|||||||
await runArchivedTask(queue, taskKey);
|
await runArchivedTask(queue, taskKey);
|
||||||
dispatch({ type: RUN_ARCHIVED_TASK_SUCCESS, queue, taskKey });
|
dispatch({ type: RUN_ARCHIVED_TASK_SUCCESS, queue, taskKey });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("runArchivedTaskAsync: ", error);
|
console.error(
|
||||||
|
"runArchivedTaskAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: RUN_ARCHIVED_TASK_ERROR,
|
type: RUN_ARCHIVED_TASK_ERROR,
|
||||||
error: `Could not run task: ${taskKey}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKey,
|
taskKey,
|
||||||
});
|
});
|
||||||
@ -1290,10 +1336,13 @@ export function deletePendingTaskAsync(queue: string, taskKey: string) {
|
|||||||
await deletePendingTask(queue, taskKey);
|
await deletePendingTask(queue, taskKey);
|
||||||
dispatch({ type: DELETE_PENDING_TASK_SUCCESS, queue, taskKey });
|
dispatch({ type: DELETE_PENDING_TASK_SUCCESS, queue, taskKey });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("deletePendingTaskAsync: ", error);
|
console.error(
|
||||||
|
"deletePendingTaskAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: DELETE_PENDING_TASK_ERROR,
|
type: DELETE_PENDING_TASK_ERROR,
|
||||||
error: `Could not delete task: ${taskKey}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKey,
|
taskKey,
|
||||||
});
|
});
|
||||||
@ -1315,10 +1364,13 @@ export function batchDeletePendingTasksAsync(
|
|||||||
payload: response,
|
payload: response,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("batchDeletePendingTasksAsync: ", error);
|
console.error(
|
||||||
|
"batchDeletePendingTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BATCH_DELETE_PENDING_TASKS_ERROR,
|
type: BATCH_DELETE_PENDING_TASKS_ERROR,
|
||||||
error: `Could not batch delete tasks: ${taskKeys}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKeys,
|
taskKeys,
|
||||||
});
|
});
|
||||||
@ -1333,10 +1385,13 @@ export function deleteScheduledTaskAsync(queue: string, taskKey: string) {
|
|||||||
await deleteScheduledTask(queue, taskKey);
|
await deleteScheduledTask(queue, taskKey);
|
||||||
dispatch({ type: DELETE_SCHEDULED_TASK_SUCCESS, queue, taskKey });
|
dispatch({ type: DELETE_SCHEDULED_TASK_SUCCESS, queue, taskKey });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("deleteScheduledTaskAsync: ", error);
|
console.error(
|
||||||
|
"deleteScheduledTaskAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: DELETE_SCHEDULED_TASK_ERROR,
|
type: DELETE_SCHEDULED_TASK_ERROR,
|
||||||
error: `Could not delete task: ${taskKey}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKey,
|
taskKey,
|
||||||
});
|
});
|
||||||
@ -1358,10 +1413,13 @@ export function batchDeleteScheduledTasksAsync(
|
|||||||
payload: response,
|
payload: response,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("batchDeleteScheduledTasksAsync: ", error);
|
console.error(
|
||||||
|
"batchDeleteScheduledTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BATCH_DELETE_SCHEDULED_TASKS_ERROR,
|
type: BATCH_DELETE_SCHEDULED_TASKS_ERROR,
|
||||||
error: `Could not batch delete tasks: ${taskKeys}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKeys,
|
taskKeys,
|
||||||
});
|
});
|
||||||
@ -1380,10 +1438,13 @@ export function batchRunScheduledTasksAsync(queue: string, taskKeys: string[]) {
|
|||||||
payload: response,
|
payload: response,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("batchRunScheduledTasksAsync: ", error);
|
console.error(
|
||||||
|
"batchRunScheduledTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BATCH_RUN_SCHEDULED_TASKS_ERROR,
|
type: BATCH_RUN_SCHEDULED_TASKS_ERROR,
|
||||||
error: `Could not batch run tasks: ${taskKeys}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKeys,
|
taskKeys,
|
||||||
});
|
});
|
||||||
@ -1405,10 +1466,13 @@ export function batchArchiveScheduledTasksAsync(
|
|||||||
payload: response,
|
payload: response,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("batchArchiveScheduledTasksAsync: ", error);
|
console.error(
|
||||||
|
"batchArchiveScheduledTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BATCH_ARCHIVE_SCHEDULED_TASKS_ERROR,
|
type: BATCH_ARCHIVE_SCHEDULED_TASKS_ERROR,
|
||||||
error: `Could not batch archive tasks: ${taskKeys}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKeys,
|
taskKeys,
|
||||||
});
|
});
|
||||||
@ -1430,10 +1494,13 @@ export function batchArchivePendingTasksAsync(
|
|||||||
payload: response,
|
payload: response,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("batchArchivePendingTasksAsync: ", error);
|
console.error(
|
||||||
|
"batchArchivePendingTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BATCH_ARCHIVE_PENDING_TASKS_ERROR,
|
type: BATCH_ARCHIVE_PENDING_TASKS_ERROR,
|
||||||
error: `Could not batch archive tasks: ${taskKeys}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKeys,
|
taskKeys,
|
||||||
});
|
});
|
||||||
@ -1448,10 +1515,13 @@ export function archiveAllPendingTasksAsync(queue: string) {
|
|||||||
await archiveAllPendingTasks(queue);
|
await archiveAllPendingTasks(queue);
|
||||||
dispatch({ type: ARCHIVE_ALL_PENDING_TASKS_SUCCESS, queue });
|
dispatch({ type: ARCHIVE_ALL_PENDING_TASKS_SUCCESS, queue });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("archiveAllPendingTasksAsync: ", error);
|
console.error(
|
||||||
|
"archiveAllPendingTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ARCHIVE_ALL_PENDING_TASKS_ERROR,
|
type: ARCHIVE_ALL_PENDING_TASKS_ERROR,
|
||||||
error: `Could not archive all pending tasks`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1465,10 +1535,13 @@ export function deleteAllPendingTasksAsync(queue: string) {
|
|||||||
await deleteAllPendingTasks(queue);
|
await deleteAllPendingTasks(queue);
|
||||||
dispatch({ type: DELETE_ALL_PENDING_TASKS_SUCCESS, queue });
|
dispatch({ type: DELETE_ALL_PENDING_TASKS_SUCCESS, queue });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("deleteAllPendingTasksAsync: ", error);
|
console.error(
|
||||||
|
"deleteAllPendingTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: DELETE_ALL_PENDING_TASKS_ERROR,
|
type: DELETE_ALL_PENDING_TASKS_ERROR,
|
||||||
error: `Could not delete all pending tasks`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1482,10 +1555,13 @@ export function deleteAllScheduledTasksAsync(queue: string) {
|
|||||||
await deleteAllScheduledTasks(queue);
|
await deleteAllScheduledTasks(queue);
|
||||||
dispatch({ type: DELETE_ALL_SCHEDULED_TASKS_SUCCESS, queue });
|
dispatch({ type: DELETE_ALL_SCHEDULED_TASKS_SUCCESS, queue });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("deleteAllScheduledTasksAsync: ", error);
|
console.error(
|
||||||
|
"deleteAllScheduledTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: DELETE_ALL_SCHEDULED_TASKS_ERROR,
|
type: DELETE_ALL_SCHEDULED_TASKS_ERROR,
|
||||||
error: `Could not delete all scheduled tasks`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1499,10 +1575,13 @@ export function runAllScheduledTasksAsync(queue: string) {
|
|||||||
await runAllScheduledTasks(queue);
|
await runAllScheduledTasks(queue);
|
||||||
dispatch({ type: RUN_ALL_SCHEDULED_TASKS_SUCCESS, queue });
|
dispatch({ type: RUN_ALL_SCHEDULED_TASKS_SUCCESS, queue });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("runAllScheduledTasksAsync: ", error);
|
console.error(
|
||||||
|
"runAllScheduledTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: RUN_ALL_SCHEDULED_TASKS_ERROR,
|
type: RUN_ALL_SCHEDULED_TASKS_ERROR,
|
||||||
error: `Could not run all scheduled tasks`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1516,10 +1595,13 @@ export function archiveAllScheduledTasksAsync(queue: string) {
|
|||||||
await archiveAllScheduledTasks(queue);
|
await archiveAllScheduledTasks(queue);
|
||||||
dispatch({ type: ARCHIVE_ALL_SCHEDULED_TASKS_SUCCESS, queue });
|
dispatch({ type: ARCHIVE_ALL_SCHEDULED_TASKS_SUCCESS, queue });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("archiveAllScheduledTasksAsync: ", error);
|
console.error(
|
||||||
|
"archiveAllScheduledTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ARCHIVE_ALL_SCHEDULED_TASKS_ERROR,
|
type: ARCHIVE_ALL_SCHEDULED_TASKS_ERROR,
|
||||||
error: `Could not archive all scheduled tasks`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1533,10 +1615,13 @@ export function deleteRetryTaskAsync(queue: string, taskKey: string) {
|
|||||||
await deleteRetryTask(queue, taskKey);
|
await deleteRetryTask(queue, taskKey);
|
||||||
dispatch({ type: DELETE_RETRY_TASK_SUCCESS, queue, taskKey });
|
dispatch({ type: DELETE_RETRY_TASK_SUCCESS, queue, taskKey });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("deleteRetryTaskAsync: ", error);
|
console.error(
|
||||||
|
"deleteRetryTaskAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: DELETE_RETRY_TASK_ERROR,
|
type: DELETE_RETRY_TASK_ERROR,
|
||||||
error: `Could not delete task: ${taskKey}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKey,
|
taskKey,
|
||||||
});
|
});
|
||||||
@ -1555,10 +1640,13 @@ export function batchDeleteRetryTasksAsync(queue: string, taskKeys: string[]) {
|
|||||||
payload: response,
|
payload: response,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("batchDeleteRetryTasksAsync: ", error);
|
console.error(
|
||||||
|
"batchDeleteRetryTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BATCH_DELETE_RETRY_TASKS_ERROR,
|
type: BATCH_DELETE_RETRY_TASKS_ERROR,
|
||||||
error: `Could not batch delete tasks: ${taskKeys}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKeys,
|
taskKeys,
|
||||||
});
|
});
|
||||||
@ -1577,10 +1665,13 @@ export function batchRunRetryTasksAsync(queue: string, taskKeys: string[]) {
|
|||||||
payload: response,
|
payload: response,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("batchRunRetryTasksAsync: ", error);
|
console.error(
|
||||||
|
"batchRunRetryTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BATCH_RUN_RETRY_TASKS_ERROR,
|
type: BATCH_RUN_RETRY_TASKS_ERROR,
|
||||||
error: `Could not batch run tasks: ${taskKeys}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKeys,
|
taskKeys,
|
||||||
});
|
});
|
||||||
@ -1599,10 +1690,13 @@ export function batchArchiveRetryTasksAsync(queue: string, taskKeys: string[]) {
|
|||||||
payload: response,
|
payload: response,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("batchArchiveRetryTasksAsync: ", error);
|
console.error(
|
||||||
|
"batchArchiveRetryTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BATCH_ARCHIVE_RETRY_TASKS_ERROR,
|
type: BATCH_ARCHIVE_RETRY_TASKS_ERROR,
|
||||||
error: `Could not batch archive tasks: ${taskKeys}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKeys,
|
taskKeys,
|
||||||
});
|
});
|
||||||
@ -1617,10 +1711,13 @@ export function deleteAllRetryTasksAsync(queue: string) {
|
|||||||
await deleteAllRetryTasks(queue);
|
await deleteAllRetryTasks(queue);
|
||||||
dispatch({ type: DELETE_ALL_RETRY_TASKS_SUCCESS, queue });
|
dispatch({ type: DELETE_ALL_RETRY_TASKS_SUCCESS, queue });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("deleteAllRetryTasksAsync: ", error);
|
console.error(
|
||||||
|
"deleteAllRetryTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: DELETE_ALL_RETRY_TASKS_ERROR,
|
type: DELETE_ALL_RETRY_TASKS_ERROR,
|
||||||
error: `Could not delete all retry tasks`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1634,10 +1731,13 @@ export function runAllRetryTasksAsync(queue: string) {
|
|||||||
await runAllRetryTasks(queue);
|
await runAllRetryTasks(queue);
|
||||||
dispatch({ type: RUN_ALL_RETRY_TASKS_SUCCESS, queue });
|
dispatch({ type: RUN_ALL_RETRY_TASKS_SUCCESS, queue });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("runAllRetryTasksAsync: ", error);
|
console.error(
|
||||||
|
"runAllRetryTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: RUN_ALL_RETRY_TASKS_ERROR,
|
type: RUN_ALL_RETRY_TASKS_ERROR,
|
||||||
error: `Could not run all retry tasks`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1651,10 +1751,13 @@ export function archiveAllRetryTasksAsync(queue: string) {
|
|||||||
await archiveAllRetryTasks(queue);
|
await archiveAllRetryTasks(queue);
|
||||||
dispatch({ type: ARCHIVE_ALL_RETRY_TASKS_SUCCESS, queue });
|
dispatch({ type: ARCHIVE_ALL_RETRY_TASKS_SUCCESS, queue });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("archiveAllRetryTasksAsync: ", error);
|
console.error(
|
||||||
|
"archiveAllRetryTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ARCHIVE_ALL_RETRY_TASKS_ERROR,
|
type: ARCHIVE_ALL_RETRY_TASKS_ERROR,
|
||||||
error: `Could not archive all retry tasks`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1668,10 +1771,13 @@ export function deleteArchivedTaskAsync(queue: string, taskKey: string) {
|
|||||||
await deleteArchivedTask(queue, taskKey);
|
await deleteArchivedTask(queue, taskKey);
|
||||||
dispatch({ type: DELETE_ARCHIVED_TASK_SUCCESS, queue, taskKey });
|
dispatch({ type: DELETE_ARCHIVED_TASK_SUCCESS, queue, taskKey });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("deleteArchivedTaskAsync: ", error);
|
console.error(
|
||||||
|
"deleteArchivedTaskAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: DELETE_ARCHIVED_TASK_ERROR,
|
type: DELETE_ARCHIVED_TASK_ERROR,
|
||||||
error: `Could not delete task: ${taskKey}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKey,
|
taskKey,
|
||||||
});
|
});
|
||||||
@ -1693,10 +1799,13 @@ export function batchDeleteArchivedTasksAsync(
|
|||||||
payload: response,
|
payload: response,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("batchDeleteArchivedTasksAsync: ", error);
|
console.error(
|
||||||
|
"batchDeleteArchivedTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BATCH_DELETE_ARCHIVED_TASKS_ERROR,
|
type: BATCH_DELETE_ARCHIVED_TASKS_ERROR,
|
||||||
error: `Could not batch delete tasks: ${taskKeys}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKeys,
|
taskKeys,
|
||||||
});
|
});
|
||||||
@ -1715,10 +1824,13 @@ export function batchRunArchivedTasksAsync(queue: string, taskKeys: string[]) {
|
|||||||
payload: response,
|
payload: response,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("batchRunArchivedTasksAsync: ", error);
|
console.error(
|
||||||
|
"batchRunArchivedTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: BATCH_RUN_ARCHIVED_TASKS_ERROR,
|
type: BATCH_RUN_ARCHIVED_TASKS_ERROR,
|
||||||
error: `Could not batch run tasks: ${taskKeys}`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
taskKeys,
|
taskKeys,
|
||||||
});
|
});
|
||||||
@ -1733,10 +1845,13 @@ export function deleteAllArchivedTasksAsync(queue: string) {
|
|||||||
await deleteAllArchivedTasks(queue);
|
await deleteAllArchivedTasks(queue);
|
||||||
dispatch({ type: DELETE_ALL_ARCHIVED_TASKS_SUCCESS, queue });
|
dispatch({ type: DELETE_ALL_ARCHIVED_TASKS_SUCCESS, queue });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("deleteAllArchivedTasksAsync: ", error);
|
console.error(
|
||||||
|
"deleteAllArchivedTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: DELETE_ALL_ARCHIVED_TASKS_ERROR,
|
type: DELETE_ALL_ARCHIVED_TASKS_ERROR,
|
||||||
error: `Could not delete all archived tasks`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1750,10 +1865,13 @@ export function runAllArchivedTasksAsync(queue: string) {
|
|||||||
await runAllArchivedTasks(queue);
|
await runAllArchivedTasks(queue);
|
||||||
dispatch({ type: RUN_ALL_ARCHIVED_TASKS_SUCCESS, queue });
|
dispatch({ type: RUN_ALL_ARCHIVED_TASKS_SUCCESS, queue });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("runAllArchivedTasksAsync: ", error);
|
console.error(
|
||||||
|
"runAllArchivedTasksAsync: ",
|
||||||
|
toErrorStringWithHttpStatus(error)
|
||||||
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: RUN_ALL_ARCHIVED_TASKS_ERROR,
|
type: RUN_ALL_ARCHIVED_TASKS_ERROR,
|
||||||
error: `Could not run all archived tasks`,
|
error: toErrorString(error),
|
||||||
queue,
|
queue,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,7 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
function mapStateToProps(state: AppState) {
|
function mapStateToProps(state: AppState) {
|
||||||
return {
|
return {
|
||||||
loading: state.tasks.activeTasks.loading,
|
loading: state.tasks.activeTasks.loading,
|
||||||
|
error: state.tasks.activeTasks.error,
|
||||||
tasks: state.tasks.activeTasks.data,
|
tasks: state.tasks.activeTasks.data,
|
||||||
batchActionPending: state.tasks.activeTasks.batchActionPending,
|
batchActionPending: state.tasks.activeTasks.batchActionPending,
|
||||||
allActionPending: state.tasks.activeTasks.allActionPending,
|
allActionPending: state.tasks.activeTasks.allActionPending,
|
||||||
@ -133,6 +134,15 @@ function ActiveTasksTable(props: Props & ReduxProps) {
|
|||||||
|
|
||||||
usePolling(fetchData, pollInterval);
|
usePolling(fetchData, pollInterval);
|
||||||
|
|
||||||
|
if (props.error.length > 0) {
|
||||||
|
return (
|
||||||
|
<Alert severity="error">
|
||||||
|
<AlertTitle>Error</AlertTitle>
|
||||||
|
{props.error}
|
||||||
|
</Alert>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (props.tasks.length === 0) {
|
if (props.tasks.length === 0) {
|
||||||
return (
|
return (
|
||||||
<Alert severity="info">
|
<Alert severity="info">
|
||||||
|
@ -72,6 +72,7 @@ const useRowStyles = makeStyles({
|
|||||||
function mapStateToProps(state: AppState) {
|
function mapStateToProps(state: AppState) {
|
||||||
return {
|
return {
|
||||||
loading: state.tasks.archivedTasks.loading,
|
loading: state.tasks.archivedTasks.loading,
|
||||||
|
error: state.tasks.archivedTasks.error,
|
||||||
tasks: state.tasks.archivedTasks.data,
|
tasks: state.tasks.archivedTasks.data,
|
||||||
batchActionPending: state.tasks.archivedTasks.batchActionPending,
|
batchActionPending: state.tasks.archivedTasks.batchActionPending,
|
||||||
allActionPending: state.tasks.archivedTasks.allActionPending,
|
allActionPending: state.tasks.archivedTasks.allActionPending,
|
||||||
@ -156,6 +157,14 @@ function ArchivedTasksTable(props: Props & ReduxProps) {
|
|||||||
|
|
||||||
usePolling(fetchData, pollInterval);
|
usePolling(fetchData, pollInterval);
|
||||||
|
|
||||||
|
if (props.error.length > 0) {
|
||||||
|
return (
|
||||||
|
<Alert severity="error">
|
||||||
|
<AlertTitle>Error</AlertTitle>
|
||||||
|
{props.error}
|
||||||
|
</Alert>
|
||||||
|
);
|
||||||
|
}
|
||||||
if (props.tasks.length === 0) {
|
if (props.tasks.length === 0) {
|
||||||
return (
|
return (
|
||||||
<Alert severity="info">
|
<Alert severity="info">
|
||||||
|
@ -57,6 +57,7 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
function mapStateToProps(state: AppState) {
|
function mapStateToProps(state: AppState) {
|
||||||
return {
|
return {
|
||||||
loading: state.tasks.pendingTasks.loading,
|
loading: state.tasks.pendingTasks.loading,
|
||||||
|
error: state.tasks.pendingTasks.error,
|
||||||
tasks: state.tasks.pendingTasks.data,
|
tasks: state.tasks.pendingTasks.data,
|
||||||
batchActionPending: state.tasks.pendingTasks.batchActionPending,
|
batchActionPending: state.tasks.pendingTasks.batchActionPending,
|
||||||
allActionPending: state.tasks.pendingTasks.allActionPending,
|
allActionPending: state.tasks.pendingTasks.allActionPending,
|
||||||
@ -141,6 +142,14 @@ function PendingTasksTable(props: Props & ReduxProps) {
|
|||||||
|
|
||||||
usePolling(fetchData, pollInterval);
|
usePolling(fetchData, pollInterval);
|
||||||
|
|
||||||
|
if (props.error.length > 0) {
|
||||||
|
return (
|
||||||
|
<Alert severity="error">
|
||||||
|
<AlertTitle>Error</AlertTitle>
|
||||||
|
{props.error}
|
||||||
|
</Alert>
|
||||||
|
);
|
||||||
|
}
|
||||||
if (props.tasks.length === 0) {
|
if (props.tasks.length === 0) {
|
||||||
return (
|
return (
|
||||||
<Alert severity="info">
|
<Alert severity="info">
|
||||||
|
@ -61,6 +61,7 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
function mapStateToProps(state: AppState) {
|
function mapStateToProps(state: AppState) {
|
||||||
return {
|
return {
|
||||||
loading: state.tasks.retryTasks.loading,
|
loading: state.tasks.retryTasks.loading,
|
||||||
|
error: state.tasks.retryTasks.error,
|
||||||
tasks: state.tasks.retryTasks.data,
|
tasks: state.tasks.retryTasks.data,
|
||||||
batchActionPending: state.tasks.retryTasks.batchActionPending,
|
batchActionPending: state.tasks.retryTasks.batchActionPending,
|
||||||
allActionPending: state.tasks.retryTasks.allActionPending,
|
allActionPending: state.tasks.retryTasks.allActionPending,
|
||||||
@ -158,6 +159,14 @@ function RetryTasksTable(props: Props & ReduxProps) {
|
|||||||
|
|
||||||
usePolling(fetchData, pollInterval);
|
usePolling(fetchData, pollInterval);
|
||||||
|
|
||||||
|
if (props.error.length > 0) {
|
||||||
|
return (
|
||||||
|
<Alert severity="error">
|
||||||
|
<AlertTitle>Error</AlertTitle>
|
||||||
|
{props.error}
|
||||||
|
</Alert>
|
||||||
|
);
|
||||||
|
}
|
||||||
if (props.tasks.length === 0) {
|
if (props.tasks.length === 0) {
|
||||||
return (
|
return (
|
||||||
<Alert severity="info">
|
<Alert severity="info">
|
||||||
|
@ -61,6 +61,7 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
function mapStateToProps(state: AppState) {
|
function mapStateToProps(state: AppState) {
|
||||||
return {
|
return {
|
||||||
loading: state.tasks.scheduledTasks.loading,
|
loading: state.tasks.scheduledTasks.loading,
|
||||||
|
error: state.tasks.scheduledTasks.error,
|
||||||
tasks: state.tasks.scheduledTasks.data,
|
tasks: state.tasks.scheduledTasks.data,
|
||||||
batchActionPending: state.tasks.scheduledTasks.batchActionPending,
|
batchActionPending: state.tasks.scheduledTasks.batchActionPending,
|
||||||
allActionPending: state.tasks.scheduledTasks.allActionPending,
|
allActionPending: state.tasks.scheduledTasks.allActionPending,
|
||||||
@ -158,6 +159,14 @@ function ScheduledTasksTable(props: Props & ReduxProps) {
|
|||||||
|
|
||||||
usePolling(fetchData, pollInterval);
|
usePolling(fetchData, pollInterval);
|
||||||
|
|
||||||
|
if (props.error.length > 0) {
|
||||||
|
return (
|
||||||
|
<Alert severity="error">
|
||||||
|
<AlertTitle>Error</AlertTitle>
|
||||||
|
{props.error}
|
||||||
|
</Alert>
|
||||||
|
);
|
||||||
|
}
|
||||||
if (props.tasks.length === 0) {
|
if (props.tasks.length === 0) {
|
||||||
return (
|
return (
|
||||||
<Alert severity="info">
|
<Alert severity="info">
|
||||||
|
@ -243,7 +243,6 @@ function tasksReducer(
|
|||||||
...state,
|
...state,
|
||||||
activeTasks: {
|
activeTasks: {
|
||||||
...state.activeTasks,
|
...state.activeTasks,
|
||||||
error: "",
|
|
||||||
loading: true,
|
loading: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -270,6 +269,7 @@ function tasksReducer(
|
|||||||
...state.activeTasks,
|
...state.activeTasks,
|
||||||
loading: false,
|
loading: false,
|
||||||
error: action.error,
|
error: action.error,
|
||||||
|
data: [],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -278,7 +278,6 @@ function tasksReducer(
|
|||||||
...state,
|
...state,
|
||||||
pendingTasks: {
|
pendingTasks: {
|
||||||
...state.pendingTasks,
|
...state.pendingTasks,
|
||||||
error: "",
|
|
||||||
loading: true,
|
loading: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -304,6 +303,7 @@ function tasksReducer(
|
|||||||
...state.pendingTasks,
|
...state.pendingTasks,
|
||||||
loading: false,
|
loading: false,
|
||||||
error: action.error,
|
error: action.error,
|
||||||
|
data: [],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -312,7 +312,6 @@ function tasksReducer(
|
|||||||
...state,
|
...state,
|
||||||
scheduledTasks: {
|
scheduledTasks: {
|
||||||
...state.scheduledTasks,
|
...state.scheduledTasks,
|
||||||
error: "",
|
|
||||||
loading: true,
|
loading: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -338,6 +337,7 @@ function tasksReducer(
|
|||||||
...state.scheduledTasks,
|
...state.scheduledTasks,
|
||||||
loading: false,
|
loading: false,
|
||||||
error: action.error,
|
error: action.error,
|
||||||
|
data: [],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -346,7 +346,6 @@ function tasksReducer(
|
|||||||
...state,
|
...state,
|
||||||
retryTasks: {
|
retryTasks: {
|
||||||
...state.retryTasks,
|
...state.retryTasks,
|
||||||
error: "",
|
|
||||||
loading: true,
|
loading: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -372,6 +371,7 @@ function tasksReducer(
|
|||||||
...state.retryTasks,
|
...state.retryTasks,
|
||||||
loading: false,
|
loading: false,
|
||||||
error: action.error,
|
error: action.error,
|
||||||
|
data: [],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -380,7 +380,6 @@ function tasksReducer(
|
|||||||
...state,
|
...state,
|
||||||
archivedTasks: {
|
archivedTasks: {
|
||||||
...state.archivedTasks,
|
...state.archivedTasks,
|
||||||
error: "",
|
|
||||||
loading: true,
|
loading: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -406,6 +405,7 @@ function tasksReducer(
|
|||||||
...state.archivedTasks,
|
...state.archivedTasks,
|
||||||
loading: false,
|
loading: false,
|
||||||
error: action.error,
|
error: action.error,
|
||||||
|
data: [],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { AxiosError } from "axios";
|
import { AxiosError } from "axios";
|
||||||
|
|
||||||
// toErrorString returns a string representaion of axios error.
|
// toErrorStringWithHttpStatus returns a string representaion of axios error with HTTP status.
|
||||||
export function toErrorString(error: AxiosError<string>): string {
|
export function toErrorStringWithHttpStatus(error: AxiosError<string>): string {
|
||||||
const { response } = error;
|
const { response } = error;
|
||||||
if (!response) {
|
if (!response) {
|
||||||
return "error: no error response data available";
|
return "error: no error response data available";
|
||||||
@ -9,6 +9,15 @@ export function toErrorString(error: AxiosError<string>): string {
|
|||||||
return `${response.status} (${response.statusText}): ${response.data}`;
|
return `${response.status} (${response.statusText}): ${response.data}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// toErrorString returns a string representaion of axios error.
|
||||||
|
export function toErrorString(error: AxiosError<string>): string {
|
||||||
|
const { response } = error;
|
||||||
|
if (!response) {
|
||||||
|
return "Unknown error occurred. See the logs for details.";
|
||||||
|
}
|
||||||
|
return response.data;
|
||||||
|
}
|
||||||
|
|
||||||
interface Duration {
|
interface Duration {
|
||||||
hour: number;
|
hour: number;
|
||||||
minute: number;
|
minute: number;
|
||||||
|
Loading…
Reference in New Issue
Block a user