Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

389 B
Raw Blame
import type { ConnectorOAuthError } from '@/utils/connectorOAuth';

export const getOAuthErrorPresentation = (
  error: string,
  messages: Record<ConnectorOAuthError['reason'], string>,
) => {
  const known = Object.hasOwn(messages, error);
  return {
    detail: known ? undefined : error,
    summary: known ? messages[error as ConnectorOAuthError['reason']] : messages.failed,
  };
};