Skip to content

Commit

Permalink
Merge pull request #61 from kytos-ng/issue_60
Browse files Browse the repository at this point in the history
Simplify error handler message on interfaces pane to display text and avoid exception
  • Loading branch information
viniarck authored May 23, 2024
2 parents 7cc4df4 + ea62d1e commit 7b84be7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Removed

Fixed
=====
- Error handler properly showing the error message as text (Issue #60)

Security
========
Expand Down
10 changes: 5 additions & 5 deletions src/kytos/interfaceInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export default {
request.fail(function(data) {
let notification = {
title: 'Interface ' + _this.next_state + 'd: Failed',
description: data.status + ': ' + data.responseJSON.description + '. The interface ' + _this.metadata.interface_id + ' was not ' + _this.next_state.toLowerCase() + 'd.',
description: data.status + ': ' + ( data.responseJSON !== undefined ? data.responseJSON.description : data.responseText ) + '. The interface ' + _this.metadata.interface_id + ' was not ' + _this.next_state.toLowerCase() + 'd.',
icon: 'cog',
}
_this.$kytos.$emit("setNotification", notification)
Expand Down Expand Up @@ -253,7 +253,7 @@ export default {
let notification = {
icon: 'cog',
title: 'Add metadata: Failure',
description: data.status + ': ' + data.responseJSON.description + ' "' + _this.to_add + '" was not added to the metadata. Interface: ' + _this.metadata.interface_id,
description: data.status + ': ' + ( data.responseJSON !== undefined ? data.responseJSON.description : data.responseText ) + ' "' + _this.to_add + '" was not added to the metadata. Interface: ' + _this.metadata.interface_id,
}
_this.$kytos.$emit("setNotification", notification)
});
Expand All @@ -280,7 +280,7 @@ export default {
let notification = {
icon: 'cog',
title: 'Delete metadata: Failure',
description: data.status + ': ' + data.responseJSON.description + ' "' + _this.to_delete + '" was not deleted from the metadata. Interface: ' + _this.metadata.interface_id,
description: data.status + ': ' + ( data.responseJSON !== undefined ? data.responseJSON.description : data.responseText ) + ' "' + _this.to_delete + '" was not deleted from the metadata. Interface: ' + _this.metadata.interface_id,
}
_this.$kytos.$emit("setNotification", notification)
});
Expand Down Expand Up @@ -323,7 +323,7 @@ export default {
_request.fail(function(data) {
let notification = {
title: 'Set ' + intf_id + ' tag_range: Succeed',
description: data.status + ': ' + data.responseJSON.description + ' "tag_ranges" change was successful '
description: data.status + ': ' + ( data.responseJSON !== undefined ? data.responseJSON.description : data.responseText ) + ' "tag_ranges" change was successful '
+ 'but there was an error obtaining the resized "available_tags". Try refreshing the page.',
icon: 'cog',
}
Expand All @@ -333,7 +333,7 @@ export default {
request.fail(function(data) {
let notification = {
title: 'Set ' + intf_id + ' tag_range: Failed',
description: data.status + ': ' + data.responseJSON.description + ' "tag_ranges" was not set.',
description: data.status + ': ' + ( data.responseJSON !== undefined ? data.responseJSON.description : data.responseText ) + ' "tag_ranges" was not set.',
icon: 'cog',
}
_this.$kytos.$emit("setNotification", notification)
Expand Down

0 comments on commit 7b84be7

Please sign in to comment.