Skip to content

Commit

Permalink
Global notifyError
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Mar 12, 2024
1 parent e2f9535 commit ac99df7
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ export function SharedLinearPileupDisplayMixin(
}
} catch (e) {
console.error(e)
session.notify(`${e}`, 'error')
session.notifyError(`${e}`, e)
}
}),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ export default function stateModelFactory(pluginManager: PluginManager) {
)
} catch (e) {
console.error(e)
getSession(self).notify(`${e}`, 'error')
getSession(self).notifyError(`${e}`, e)
}
}),
)
Expand Down
2 changes: 1 addition & 1 deletion plugins/data-management/src/ucsc-trackhub/doConnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export async function doConnect(self: any) {
}
} catch (e) {
console.error(e)
session.notify(`${getConf(self, 'name')}: "${e}"`, 'error')
session.notifyError(`${getConf(self, 'name')}: "${e}"`, e)
session.breakConnection?.(self.configuration)
}
}
2 changes: 1 addition & 1 deletion plugins/dotplot-view/src/LaunchDotplotView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function LaunchDotplotView(pluginManager: PluginManager) {
)
}
} catch (e) {
session.notify(`${e}`, 'error')
session.notifyError(`${e}`, e)
throw e
}
},
Expand Down
4 changes: 2 additions & 2 deletions plugins/legacy-jbrowse/src/JBrowse1Connection/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ export default function (pluginManager: PluginManager) {
self.setTrackConfs(jb2Tracks)
} catch (error) {
console.error(error)
session.notify(
session.notifyError(
`There was a problem connecting to the JBrowse 1 data directory "${self.name}". Please make sure you have entered a valid location. The error that was thrown is: "${error}"`,
'error',
error,
)
session.breakConnection?.(self.configuration)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ export default function LaunchSyntenyViewDialog({
model,
})
} catch (e) {
getSession(model).notify(`${e}`, 'error')
console.error(e)
getSession(model).notifyError(`${e}`, e)
}
})()
handleClose()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default function LaunchLinearSyntenyView(pluginManager: PluginManager) {
)
}
} catch (e) {
session.notify(`${e}`, 'error')
session.notifyError(`${e}`, e)
throw e
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ export default function SyntenyContextMenu({
.navToLocString(`${refName}:${start}-${end}`)
.catch(e => {
console.error(e)
getSession(model).notify(`${e}`, 'error')
getSession(model).notifyError(`${e}`, e)
})
view.views[1]
.navToLocString(`${mate.refName}:${mate.start}-${mate.end}`)
.catch(e => {
console.error(e)
getSession(model).notify(`${e}`, 'error')
getSession(model).notifyError(`${e}`, e)
})
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ const DataCellReactComponent = observer(function ({
await locationLinkClick(spreadsheet, columnNumber, cell)
} catch (e) {
console.error(e)
session.notify(`${e}`, 'error')
session.notifyError(`${e}`, e)
}
}}
title="open a new linear genome view here"
Expand Down
8 changes: 4 additions & 4 deletions products/jbrowse-desktop/src/rootModel/Menus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function DesktopMenusMixin(_pluginManager: PluginManager) {
}
} catch (e) {
console.error(e)
self.session?.notify(`${e}`, 'error')
self.session?.notifyError(`${e}`, e)
}
},
},
Expand All @@ -67,7 +67,7 @@ export function DesktopMenusMixin(_pluginManager: PluginManager) {
await self.saveSession(getSaveSession(self))
} catch (e) {
console.error(e)
self.session?.notify(`${e}`, 'error')
self.session?.notifyError(`${e}`, e)
}
}
},
Expand All @@ -84,7 +84,7 @@ export function DesktopMenusMixin(_pluginManager: PluginManager) {
await self.saveSession(getSaveSession(self))
} catch (e) {
console.error(e)
self.session?.notify(`${e}`, 'error')
self.session?.notifyError(`${e}`, e)
}
},
},
Expand All @@ -110,7 +110,7 @@ export function DesktopMenusMixin(_pluginManager: PluginManager) {
})
} catch (e) {
console.error(e)
self.session?.notify(`${e}`)
self.session?.notifyError(`${e}`, e)
}
doneCallback()
},
Expand Down

0 comments on commit ac99df7

Please sign in to comment.