refactor: handle undefined (#479)

This commit is contained in:
Carlos Valente
2023-08-11 10:54:24 +02:00
committed by GitHub
parent b579a4c57e
commit c361ff4b3f
+1 -1
View File
@@ -7,7 +7,7 @@ import { nowInMillis } from '../utils/time';
export function logAxiosError(prepend: string, error: unknown) {
const message = axios.isAxiosError(error)
? `${prepend}, ${(error as AxiosError).response?.statusText}: ${(error as AxiosError).response?.data}`
? `${prepend} ${(error as AxiosError).response?.statusText ?? ''}: ${(error as AxiosError).response?.data ?? ''}`
: `${prepend}: ${error}`;
addLog({