Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,9 @@ const isOssQueryAllowed = async (
} catch (error) {
return false;
}
};
return { success: true, message: 'Query sent successfully.' };

const OssSlack: FC<{
apiKey: string;
vectorDBUrl: string;
chatHist: Array<{ question: string; answer: string }>;
throw error;
Comment on lines +242 to +244

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The throw error; statement is unreachable because the function will always return before it. If you want to throw an error when something goes wrong, you should do it inside the catch block.

   } catch (error) {
-    return false;
+    throw error;
   }
-  return { success: true, message: 'Query sent successfully.' };
-  
-  throw error;
+  return { success: true, message: 'Query sent successfully.' };

theme?: string;
}> = ({ apiKey, vectorDBUrl, chatHist, theme = 'light' }) => {
const validTheme = theme === 'dark' ? 'dark' : 'light';
Expand Down