Improve error logging in Juniper

This commit is contained in:
Marcus Blättermann 2022-12-14 14:46:49 +01:00
parent 8153920ed5
commit 0b50883a96
No known key found for this signature in database
GPG Key ID: A1E1F04008AC450D

View File

@ -54,7 +54,7 @@ export default class Juniper extends React.Component {
const es = new EventSource(binderUrl)
es.onerror = (err) => {
es.close()
this.log(() => console.error('failed'))
this.log(() => console.error('failed', err))
reject(new Error(err))
}
let phase = null
@ -149,8 +149,8 @@ export default class Juniper extends React.Component {
this.state.kernel
.restart()
.then(() => this.renderResponse(outputArea, code))
.catch(() => {
this.log(() => console.error('failed'))
.catch((err) => {
this.log(() => console.error('failed', err))
this.setState({ kernel: null })
outputArea.model.clear()
outputArea.model.add({
@ -178,8 +178,8 @@ export default class Juniper extends React.Component {
this.setState({ kernel })
this.renderResponse(outputArea, code)
})
.catch(() => {
this.log(() => console.error('failed'))
.catch((err) => {
this.log(() => console.error('failed', err))
this.setState({ kernel: null })
if (this.props.useStorage) {
this.setState({ fromStorage: false })