mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-10-07 12:42:00 +08:00
Show error alert when data is not available
This commit is contained in:
@@ -1,3 +1,14 @@
|
||||
import { AxiosError } from "axios";
|
||||
|
||||
// toErrorString returns a string representaion of axios error.
|
||||
export function toErrorString(error: AxiosError<string>): string {
|
||||
const { response } = error;
|
||||
if (!response) {
|
||||
return "error: no error response data available";
|
||||
}
|
||||
return `${response.status} (${response.statusText}): ${response.data}`;
|
||||
}
|
||||
|
||||
interface Duration {
|
||||
hour: number;
|
||||
minute: number;
|
||||
|
Reference in New Issue
Block a user