Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
import axios from "axios";
import { createNotification } from "@app/components/notifications";
import { ApiErrorTypes, TApiErrors } from "@app/hooks/api/types";
export const notifyUnhandledHostCommandError = (error: unknown, title: string) => {
if (!axios.isAxiosError(error)) return;
const serverResponse = error.response?.data as TApiErrors | undefined;
if (serverResponse?.error !== ApiErrorTypes.BadRequestError) return;
const text = typeof serverResponse.message === "string" ? serverResponse.message : "Try again.";
createNotification({ title, text, type: "error" });
};