Skip to content

Commit

Permalink
Log view: display any errors in listing the log files
Browse files Browse the repository at this point in the history
  • Loading branch information
MetRonnie committed Jun 24, 2024
1 parent fe809ec commit 59439c6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/views/Log.vue
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ import gql from 'graphql-tag'
import ViewToolbar from '@/components/cylc/ViewToolbar.vue'
import DeltasCallback from '@/services/callbacks'
import debounce from 'lodash/debounce'
import { Alert } from '@/model/Alert.model'

/**
* Query used to retrieve data for the Log view.
Expand Down Expand Up @@ -507,7 +508,7 @@ export default {
})
} catch (err) {
// the query failed
console.warn(err)
this.handleLogFileListingErr(err)

Check warning on line 511 in src/views/Log.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Log.vue#L511

Added line #L511 was not covered by tests
this.handleNoLogFiles()
return
}
Expand Down Expand Up @@ -536,6 +537,9 @@ export default {
this.fileDisabled = false
this.logFiles = logFiles
} else {
if (result.errors?.length) {
this.handleLogFileListingErr(result.errors[0].message)

Check warning on line 541 in src/views/Log.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Log.vue#L541

Added line #L541 was not covered by tests
}
this.handleNoLogFiles()
}
},
Expand All @@ -544,6 +548,9 @@ export default {
this.fileDisabled = true
this.logFiles = []
},
handleLogFileListingErr (err) {
this.$store.dispatch('setAlert', new Alert(err, 'error'))

Check warning on line 552 in src/views/Log.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Log.vue#L552

Added line #L552 was not covered by tests
},
},

watch: {
Expand Down

0 comments on commit 59439c6

Please sign in to comment.