Skip to content

Commit

Permalink
feature(frontend): improving error messaging for the trace results (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
xoscar committed Apr 17, 2023
1 parent bdd88ff commit afe6915
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion server/executor/trace_poller.go
Expand Up @@ -216,7 +216,7 @@ func (tp tracePoller) handleTraceDBError(job PollingRequest, err error) (bool, s
reason := ""

if errors.Is(err, connection.ErrTraceNotFound) {
reason = "Timed out without finding trace"
reason = fmt.Sprintf("Timed out without finding trace, trace id \"%s\"", run.TraceID.String())

err = fmt.Errorf("timed out waiting for traces after %s", pp.Timeout)
fmt.Println("[TracePoller] Timed-out", err)
Expand Down
19 changes: 14 additions & 5 deletions web/src/components/RunEvents/RunEventDataStore.tsx
@@ -1,4 +1,5 @@
import {Typography} from 'antd';
import {Link} from 'react-router-dom';
import TestConnectionNotification from 'components/TestConnectionNotification/TestConnectionNotification';
import {IPropsEvent} from './RunEvent';
import * as S from './RunEvents.styled';
Expand All @@ -10,11 +11,19 @@ const RunEventDataStore = ({event}: IPropsEvent) => (
<Typography.Text>{event.description}</Typography.Text>
{!!event.dataStoreConnection && (
<S.Content>
<Typography.Title level={3}>
{event.dataStoreConnection?.allPassed
? 'Data store configuration is valid.'
: 'Data store configuration is not valid.'}
</Typography.Title>
{event.dataStoreConnection?.allPassed ? (
<Typography.Title level={3}>Data store configuration is valid.</Typography.Title>
) : (
<S.InvalidDataStoreContainer>
<Typography.Title level={3} style={{margin: 0}}>
Data store configuration is not valid.
</Typography.Title>
<Typography.Text>
You can go to the <Link to="/settings">settings page</Link> to fix it.
</Typography.Text>
</S.InvalidDataStoreContainer>
)}

<TestConnectionNotification result={event.dataStoreConnection} />
</S.Content>
)}
Expand Down
7 changes: 7 additions & 0 deletions web/src/components/RunEvents/RunEvents.styled.ts
Expand Up @@ -88,3 +88,10 @@ export const LoadingIcon = styled(LoadingOutlined)`
export const Paragraph = styled(Typography.Paragraph)`
text-align: center;
`;

export const InvalidDataStoreContainer = styled.div`
display: flex;
align-items: center;
gap: 2px;
margin-bottom: 5px;
`;

0 comments on commit afe6915

Please sign in to comment.