Skip to content

Commit

Permalink
Merge pull request #72 from at88mph/cadc-menu-items-fix
Browse files Browse the repository at this point in the history
Correcting error messages to the user when max sessions reached.  Thi…
  • Loading branch information
at88mph authored Jul 16, 2024
2 parents c3df7b8 + 48c60f1 commit 4764806
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 4764806

Please sign in to comment.