Skip to content

Commit 651f0c7

Browse files
authored
fix: stopgap error messages (#4935)
1 parent 9207cb2 commit 651f0c7

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

src/dataExplorer/components/QueryTime.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
.query-status {
44
flex-grow: 1;
5+
margin-top: 14px;
56

67
.status {
78
width: 12px;
@@ -26,4 +27,10 @@
2627
background: $c-rainforest;
2728
}
2829
}
30+
31+
pre {
32+
color: $c-fire;
33+
font-family: $cf-code-font;
34+
margin: $cf-space-2xs;
35+
}
2936
}

src/dataExplorer/components/QueryTime.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const humanReadable = (time: number): string => {
99
}
1010

1111
const QueryTime: FC = () => {
12-
const {status, time} = useContext(ResultsContext)
12+
const {result, status, time} = useContext(ResultsContext)
1313

1414
if (status === RemoteDataState.Done) {
1515
return (
@@ -42,6 +42,7 @@ const QueryTime: FC = () => {
4242
<div className="query-status">
4343
<div className="status error" />
4444
<label>Error ({humanReadable(time)})</label>
45+
<pre>{result.error}</pre>
4546
</div>
4647
)
4748
}

src/dataExplorer/components/ResultsPane.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
FlexBox,
1414
FlexDirection,
1515
JustifyContent,
16+
AlignItems,
1617
} from '@influxdata/clockface'
1718
import {createLocalStorageStateHook} from 'use-local-storage-state'
1819

@@ -122,7 +123,12 @@ const ResultsPane: FC = () => {
122123
setResult(r)
123124
setStatus(RemoteDataState.Done)
124125
})
125-
.catch(() => {
126+
.catch(e => {
127+
setResult({
128+
source: text,
129+
parsed: null,
130+
error: e.message,
131+
})
126132
event('resultReceived', {status: 'error'})
127133
setStatus(RemoteDataState.Error)
128134
})
@@ -172,6 +178,7 @@ const ResultsPane: FC = () => {
172178
<FlexBox
173179
direction={FlexDirection.Row}
174180
justifyContent={JustifyContent.FlexEnd}
181+
alignItems={AlignItems.FlexStart}
175182
margin={ComponentSize.Small}
176183
>
177184
<QueryTime />

0 commit comments

Comments
 (0)