mirror of
https://github.com/fleetdm/fleet
synced 2026-05-17 05:58:40 +00:00
13 lines
380 B
TypeScript
13 lines
380 B
TypeScript
import { getErrorReason } from "interfaces/errors";
|
|
|
|
const UPLOAD_ERROR_MESSAGES = {
|
|
default: {
|
|
message: "Couldn't add. Please try again.",
|
|
},
|
|
};
|
|
|
|
// eslint-disable-next-line import/prefer-default-export
|
|
export const getErrorMessage = (err: unknown) => {
|
|
if (typeof err === "string") return err;
|
|
return getErrorReason(err) || UPLOAD_ERROR_MESSAGES.default.message;
|
|
};
|