Skip to content

Commit

Permalink
chore: change more console.log to console.error, add alias import
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrisse committed May 24, 2024
1 parent 3a51c45 commit 29e7556
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/leapfrogai_ui/src/routes/api/assistants/delete/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function DELETE({ request, locals: { supabase, getSession } }) {

const assistantDeleted = await openai.beta.assistants.del(requestData.id);
if (!assistantDeleted.deleted) {
console.log(`error deleting assistant: ${JSON.stringify(assistantDeleted)}`);
console.error(`error deleting assistant: ${JSON.stringify(assistantDeleted)}`);
error(500, 'Error deleting assistant');
}

Expand All @@ -30,7 +30,9 @@ export async function DELETE({ request, locals: { supabase, getSession } }) {
.remove([requestData.id]);
if (supabaseError) {
// fail silently
console.log(`Error deleting assistant avatar. AssistantId: ${requestData.id}, error: ${error}`);
console.error(
`Error deleting assistant avatar. AssistantId: ${requestData.id}, error: ${error}`
);
}

return new Response(undefined, { status: 204 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function DELETE({ request, locals: { getSession } }) {
);

if (!messageDeleted.deleted) {
console.log(`error deleting message: ${JSON.stringify(messageDeleted)}`);
console.error(`error deleting message: ${JSON.stringify(messageDeleted)}`);
error(500, 'Error deleting message');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export const actions = {
try {
await openai.beta.assistants.update(form.data.id, assistant);
} catch (e) {
console.log(`Error updating assistant: ${e}`);
console.error(`Error updating assistant: ${e}`);
return fail(500, { message: 'Error updating assistant.' });
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const actions = {
try {
createdAssistant = (await openai.beta.assistants.create(assistant)) as LFAssistant;
} catch (e) {
console.log(`Error creating assistant: ${e}`);
console.error(`Error creating assistant: ${e}`);
return fail(500, { message: 'Error creating assistant.' });
}

Expand All @@ -88,7 +88,7 @@ export const actions = {
}
});
} catch (e) {
console.log(`Error adding avatar to assistant: ${e}`);
console.error(`Error adding avatar to assistant: ${e}`);
return fail(500, { message: 'Error adding avatar to assistant.' });
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/leapfrogai_ui/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const config = {
$assets: 'src/lib/assets',
$schemas: 'src/lib/schemas',
$constants: 'src/lib/constants',
$testUtils: 'testUtils',
$testUtils: 'testUtils'
}
}
};
Expand Down

0 comments on commit 29e7556

Please sign in to comment.