Use errorMessage (#6749)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
Douwe Osinga
2026-01-28 10:29:10 -05:00
committed by GitHub
parent 7f98f1f5f9
commit 710e7f35ed
29 changed files with 109 additions and 100 deletions
@@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
import { IoIosCloseCircle, IoIosWarning, IoIosInformationCircle } from 'react-icons/io';
import { FaPencilAlt, FaSave } from 'react-icons/fa';
import { cn } from '../../utils';
import { errorMessage } from '../../utils/conversionUtils';
import { Alert, AlertType } from './types';
import { upsertConfig } from '../../api';
import { useConfig } from '../ConfigContext';
@@ -90,7 +91,7 @@ export const AlertBox = ({ alert, className }: AlertBoxProps) => {
} catch (error) {
console.error('Error saving threshold:', error);
window.alert(
`Failed to save threshold: ${error instanceof Error ? error.message : 'Unknown error'}`
`Failed to save threshold: ${errorMessage(error, 'Unknown error')}`
);
} finally {
setIsSaving(false);