Skip to content

Commit

Permalink
Correctly report all errors loading an activities file.
Browse files Browse the repository at this point in the history
  • Loading branch information
szschaler committed Feb 13, 2024
1 parent 48c1f36 commit c65cb90
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions platform/src/ActivityManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,12 @@ class ActivityManager {
let errors = [];
let fileContent

try{
try {
let file = this.fileHandler.fetchFile( this.activitiesUrl , urlParamPrivateRepo() );
fileContent = file.content;
} catch (e) {
if (e instanceof DOMException){
errors.push( new EducationPlatformError(`The activity configuration file was not accessible at: ${this.activitiesUrl}.
Check the activity file is available at the given url.`) );
}
errors.push( new EducationPlatformError(`The activity configuration file was not accessible at: ${this.activitiesUrl}.
Check the activity file is available at the given url and you have the correct access rights.`) );
}

if (fileContent != null){
Expand Down

0 comments on commit c65cb90

Please sign in to comment.