Commit cf07930 1 parent ec036a0 commit cf07930 Copy full SHA for cf07930
File tree 3 files changed +20
-3
lines changed
plugins/linear-genome-view/src/BaseLinearDisplay/components
3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { toArray } from 'rxjs/operators'
3
3
import { isStateTreeNode , getSnapshot } from 'mobx-state-tree'
4
4
import { ObservableCreate } from '../util/rxjs'
5
5
import { checkAbortSignal } from '../util'
6
+ import { FeatureError } from '../util/types'
6
7
import { Feature } from '../util/simpleFeature'
7
8
import {
8
9
readConfObject ,
@@ -169,8 +170,9 @@ export abstract class BaseFeatureDataAdapter extends BaseAdapter {
169
170
checkAbortSignal ( opts . signal )
170
171
if ( ! hasData ) {
171
172
observer . error (
172
- new Error (
173
+ new FeatureError (
173
174
`refName "${ region . refName } " not found. You may need to configure refName aliases.` ,
175
+ 'info' ,
174
176
) ,
175
177
)
176
178
} else {
Original file line number Diff line number Diff line change @@ -400,6 +400,20 @@ export function isRetryException(exception: Error): boolean {
400
400
)
401
401
}
402
402
403
+ export class FeatureError extends Error {
404
+ constructor (
405
+ public message : string ,
406
+ public severity : 'error' | 'warning' | 'info' = 'error' ,
407
+ ) {
408
+ super ( message )
409
+ this . name = 'FeatureError'
410
+ }
411
+ }
412
+
413
+ export function isFeatureError ( error : Error ) : error is FeatureError {
414
+ return error . name === 'FeatureError'
415
+ }
416
+
403
417
export interface BlobLocation extends SnapshotIn < typeof MUBlobLocation > { }
404
418
405
419
export type FileLocation = LocalPathLocation | UriLocation | BlobLocation
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { makeStyles } from 'tss-react/mui'
4
4
import { observer } from 'mobx-react'
5
5
import { getParent } from 'mobx-state-tree'
6
6
import { getParentRenderProps } from '@jbrowse/core/util/tracks'
7
+ import { isFeatureError } from '@jbrowse/core/util/types'
7
8
import RefreshIcon from '@mui/icons-material/Refresh'
8
9
9
10
const useStyles = makeStyles ( ) ( theme => ( {
@@ -118,9 +119,9 @@ function BlockError({
118
119
return (
119
120
< div className = { classes . blockMessage } >
120
121
< Alert
121
- severity = " error"
122
+ severity = { isFeatureError ( error ) ? error . severity : 'error' }
122
123
action = {
123
- reload ? (
124
+ ! isFeatureError ( error ) || error . severity === 'error' ? (
124
125
< Button
125
126
data-testid = "reload_button"
126
127
onClick = { reload }
You can’t perform that action at this time.
0 commit comments