mirror of
https://github.com/fleetdm/fleet
synced 2026-05-05 22:39:17 +00:00
## #23341 <img width="1305" alt="Screenshot 2024-10-30 at 10 13 27 AM" src="https://github.com/user-attachments/assets/c085f77c-4620-4f62-9f2c-0fe7fd9dec8b"> - [x] Changes file added for user-visible changes in `changes/` - [x] Manual QA for all new/changed functionality - [ ] Cherry-pick and PR into RC --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
16 lines
422 B
TypeScript
16 lines
422 B
TypeScript
import { getErrorReason } from "interfaces/errors";
|
|
|
|
const DEFAULT_ERROR_MESSAGE = "Could not update. Please try again.";
|
|
|
|
// eslint-disable-next-line import/prefer-default-export
|
|
export const getErrorMessage = (e: unknown) => {
|
|
let errorMessage = getErrorReason(e, {
|
|
reasonIncludes: "Cannot reuse old password",
|
|
});
|
|
|
|
if (!errorMessage) {
|
|
errorMessage = DEFAULT_ERROR_MESSAGE;
|
|
}
|
|
|
|
return errorMessage;
|
|
};
|