File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -664,11 +664,16 @@ export default {
664664 deleteAndAddDeviceType () {
665665 this .showDeviceTypeChangeDialog = false
666666 this .deleteEpt (this .endpointReference )
667- this .newEpt ()
667+ .then (() => {
668+ this .newEpt ()
669+ })
670+ .catch ((err ) => {
671+ console .error (' Error in deleteAndAddDeviceType:' , err)
672+ })
668673 },
669674 deleteEpt (endpointReference ) {
670675 // Logic to delete the existing endpoint
671- this .$store
676+ return this .$store
672677 .dispatch (' zap/deleteEndpoint' , endpointReference)
673678 .then (() => {
674679 return this .$store .dispatch (
@@ -677,9 +682,8 @@ export default {
677682 )
678683 })
679684 .catch ((err ) => {
680- console .error (
681- ` Error deleting endpoint ${ endpointReference} : ${ err .message } `
682- )
685+ const errorMsg = ` Error deleting endpoint ${ endpointReference} : ${ err .message || err} `
686+ throw new Error (errorMsg) // Throw formatted error
683687 })
684688 },
685689 reqValue (value ) {
You can’t perform that action at this time.
0 commit comments