-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: playground error propagation (#187)
* feat: propagate error playground * fix: prettier * test: ensuring alert component is displayed if QueryState send one * fix: remove useless comment * fix: adding error to console.error Signed-off-by: axel7083 <[email protected]> * Update packages/backend/src/managers/playground.ts Co-authored-by: Luca Stocchi <[email protected]> --------- Signed-off-by: axel7083 <[email protected]> Co-authored-by: Luca Stocchi <[email protected]>
- Loading branch information
Showing
5 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<script lang="ts"> | ||
import Fa from 'svelte-fa'; | ||
import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons'; | ||
import Tooltip from './Tooltip.svelte'; | ||
export let error: string; | ||
export let icon = false; | ||
</script> | ||
|
||
{#if icon} | ||
{#if error !== undefined && error !== ''} | ||
<Tooltip tip="{error}" top> | ||
<Fa size="18" class="cursor-pointer text-red-500 {$$props.class}" icon="{faExclamationCircle}" /> | ||
</Tooltip> | ||
{/if} | ||
{:else} | ||
<div | ||
class="text-red-500 p-1 flex flex-row items-center {$$props.class}" | ||
class:opacity-0="{error === undefined || error === ''}"> | ||
<Fa size="18" class="cursor-pointer text-red-500" icon="{faExclamationCircle}" /> | ||
<div role="alert" aria-label="Error Message Content" class="ml-2">{error}</div> | ||
</div> | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ export interface QueryState { | |
modelId: string; | ||
prompt: string; | ||
response?: ModelResponse; | ||
error?: string; | ||
} |