mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
for #19453  I don't know how to test this in the server without a significant refactor. # Checklist for submitter If some of the following don't apply, delete the relevant line. <!-- Note that API documentation changes are now addressed by the product design team. --> - [ ] Added/updated tests - [x] Manual QA for all new/changed functionality
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;
|
|
};
|