rebrand ai-chatbot to openchat across app and api (#1418)
This commit is contained in:
parent
9d5d8a3ea7
commit
f7b6b55a8b
17 changed files with 90 additions and 90 deletions
|
|
@ -8,7 +8,7 @@ import { type ClassValue, clsx } from 'clsx';
|
|||
import { formatISO } from 'date-fns';
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
import type { DBMessage, Document } from '@/lib/db/schema';
|
||||
import { ChatSDKError, type ErrorCode } from './errors';
|
||||
import { OpenChatError, type ErrorCode } from './errors';
|
||||
import type { ChatMessage, ChatTools, CustomUIDataTypes } from './types';
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
|
|
@ -20,7 +20,7 @@ export const fetcher = async (url: string) => {
|
|||
|
||||
if (!response.ok) {
|
||||
const { code, cause } = await response.json();
|
||||
throw new ChatSDKError(code as ErrorCode, cause);
|
||||
throw new OpenChatError(code as ErrorCode, cause);
|
||||
}
|
||||
|
||||
return response.json();
|
||||
|
|
@ -35,13 +35,13 @@ export async function fetchWithErrorHandlers(
|
|||
|
||||
if (!response.ok) {
|
||||
const { code, cause } = await response.json();
|
||||
throw new ChatSDKError(code as ErrorCode, cause);
|
||||
throw new OpenChatError(code as ErrorCode, cause);
|
||||
}
|
||||
|
||||
return response;
|
||||
} catch (error: unknown) {
|
||||
if (typeof navigator !== 'undefined' && !navigator.onLine) {
|
||||
throw new ChatSDKError('offline:chat');
|
||||
throw new OpenChatError('offline:chat');
|
||||
}
|
||||
|
||||
throw error;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue