Skip to content

Commit

Permalink
Correcting error messages to the user when max sessions reached. This…
Browse files Browse the repository at this point in the history
… will print proper error messages for other potential problems as well.
  • Loading branch information
at88mph committed Jul 16, 2024
1 parent 3831895 commit 48c60f1
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions public/dev/js/science_portal_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,9 @@
}
_rApp.setNotAuthenticated(userState)
} else {
var alertMsg = message.status + ": " + getRcDisplayText(message)
setPageState(pageSection,"danger", false, alertMsg)
const errorMessage = getRcDisplayText(message)
console.error(`${message.status}: ${errorMessage}`)
setPageState(pageSection, "danger", false, errorMessage)
hideModal()
}
}
Expand Down Expand Up @@ -308,17 +309,11 @@
displayText = "You are not authorised to use Skaha resources. Contact CANFAR admin" +
" for information on how to get set up with a resource allocation and permission to access the service."
break
case 400:
// Do as good a test for max number of sessions reached message from Skaha as possible:
if (request.responseText.includes("session already running")) {
displayText = "Limit of number of sessions of selected type reached"
break
}
case 501:
displayText = 'The Skaha web service is not configured in the Registry.'
break;
default:
displayText = request.responseText
displayText = request.responseText ? request.responseText.trim() : "Unknown error"
break
}

Expand Down

0 comments on commit 48c60f1

Please sign in to comment.