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 authored and schoren committed Jun 5, 2023
1 parent 5b7a4ec commit 90aa664
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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 90aa664

Please sign in to comment.