// src/app/utils/error.utils.ts
function getErrorMessage(err, fallback) {
  const errors = err?.errors;
  if (!errors)
    return fallback;
  if (Array.isArray(errors)) {
    return errors[0]?.errorMessage ?? fallback;
  }
  const first = Object.values(errors).flat()[0];
  return (typeof first === "string" ? first : null) ?? fallback;
}

export {
  getErrorMessage
};
//# sourceMappingURL=chunk-QDZ3GX5R.js.map
