From 1a7af808e77c8c972e4dfd62504381c60f3e5920 Mon Sep 17 00:00:00 2001 From: John Saigle Date: Wed, 28 Nov 2018 16:57:03 -0500 Subject: [PATCH 1/4] Make debugging more verbose --- php/libraries/Module.class.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/php/libraries/Module.class.inc b/php/libraries/Module.class.inc index d86ac334531..51e529472c8 100644 --- a/php/libraries/Module.class.inc +++ b/php/libraries/Module.class.inc @@ -76,7 +76,9 @@ class Module extends \LORIS\Router\PrefixRouter implements RequestHandlerInterfa . strtolower(substr($class, strlen("LORIS\\$name\\"))) . ".class.inc"; if (!file_exists($fpath)) { - throw new \NotFound($name); + throw new \LorisException( + "Could not resolve $fpath to a LORIS module." + ); } include $fpath; } From d44f154c3d3aa21c4e1ddf63f4117b1f80f1b443 Mon Sep 17 00:00:00 2001 From: John Saigle Date: Wed, 28 Nov 2018 17:04:04 -0500 Subject: [PATCH 2/4] Add lowercase note --- php/libraries/Module.class.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/php/libraries/Module.class.inc b/php/libraries/Module.class.inc index 51e529472c8..7ec67e24dfc 100644 --- a/php/libraries/Module.class.inc +++ b/php/libraries/Module.class.inc @@ -77,7 +77,9 @@ class Module extends \LORIS\Router\PrefixRouter implements RequestHandlerInterfa . ".class.inc"; if (!file_exists($fpath)) { throw new \LorisException( - "Could not resolve $fpath to a LORIS module." + "Could not resolve $fpath to a LORIS module. " . + "Note that PHP filenames within modules must be " . + "entirely lowercase." ); } include $fpath; From 7317721839055b5a880888bd2761703d1e2b4d0d Mon Sep 17 00:00:00 2001 From: John Saigle Date: Thu, 29 Nov 2018 12:27:28 -0500 Subject: [PATCH 3/4] Change LorisException back to NotFound --- php/libraries/Module.class.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/libraries/Module.class.inc b/php/libraries/Module.class.inc index 7ec67e24dfc..1f0547ef99f 100644 --- a/php/libraries/Module.class.inc +++ b/php/libraries/Module.class.inc @@ -76,7 +76,7 @@ class Module extends \LORIS\Router\PrefixRouter implements RequestHandlerInterfa . strtolower(substr($class, strlen("LORIS\\$name\\"))) . ".class.inc"; if (!file_exists($fpath)) { - throw new \LorisException( + throw new \NotFound( "Could not resolve $fpath to a LORIS module. " . "Note that PHP filenames within modules must be " . "entirely lowercase." From 8f0091f6bf957b4da5e441a93479116d324430f7 Mon Sep 17 00:00:00 2001 From: John Saigle Date: Wed, 12 Dec 2018 15:44:01 -0500 Subject: [PATCH 4/4] Change error message --- php/libraries/Module.class.inc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/php/libraries/Module.class.inc b/php/libraries/Module.class.inc index 1f0547ef99f..7956f5df294 100644 --- a/php/libraries/Module.class.inc +++ b/php/libraries/Module.class.inc @@ -77,9 +77,8 @@ class Module extends \LORIS\Router\PrefixRouter implements RequestHandlerInterfa . ".class.inc"; if (!file_exists($fpath)) { throw new \NotFound( - "Could not resolve $fpath to a LORIS module. " . - "Note that PHP filenames within modules must be " . - "entirely lowercase." + "Could not load module `$name`: file `$fpath` " . + "does not exist" ); } include $fpath;