Skip to content

Commit

Permalink
Merge pull request #43 from Treescrub/module-load-print
Browse files Browse the repository at this point in the history
Added debug info when module script does not exist
  • Loading branch information
Treescrub authored Jun 12, 2021
2 parents 8a7cb85 + 201167c commit 6d9647c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions AcornLib/AcornLib.nut
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,13 @@ function LoadModule(name) {

moduleTable.setdelegate(this)

IncludeScript(GetFullModulePath(name), moduleTable)
if(!IncludeScript(GetFullModulePath(name), moduleTable)) {
printl("Failed to load module: Module \"" + name + "\" does not exist")
return false
}

if(!TableIsModule(moduleTable)) {
printl("Failed to load module: Module \"" + name + "\" is not a valid module or does not exist")
printl("Failed to load module: Module \"" + name + "\" is not a valid module")
return false
}

Expand Down

0 comments on commit 6d9647c

Please sign in to comment.