You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 10:03:58 UTC

[sling-org-apache-sling-scripting-java] 24/41: Improve exception messages.

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit e815996da4fb3329d20f744b6adccf6e5329ec2f
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Jul 7 09:13:36 2009 +0000

    Improve exception messages.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@791764 13f79535-47bb-0310-9956-ffa450edef68
---
 .../java/org/apache/sling/scripting/java/CompilationContext.java   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/scripting/java/CompilationContext.java b/src/main/java/org/apache/sling/scripting/java/CompilationContext.java
index 8c5e41b..2de7af7 100644
--- a/src/main/java/org/apache/sling/scripting/java/CompilationContext.java
+++ b/src/main/java/org/apache/sling/scripting/java/CompilationContext.java
@@ -196,12 +196,13 @@ public class CompilationContext {
      */
     public Class load()
     throws ServletException, FileNotFoundException {
+        final String name = this.getClassFilePath().substring(1).replace('/', '.');
         try {
-            servletClass = this.options.getClassLoader().loadClass(this.getClassFilePath().substring(1).replace('/', '.'));
+            servletClass = this.options.getClassLoader().loadClass(name);
         } catch (ClassNotFoundException cex) {
-            throw new ServletException("Unable to load servlet class.", cex);
+            throw new ServletException("Servlet class not found: " + name, cex);
         } catch (Exception ex) {
-            throw new ServletException("Unable to compile servlet.", ex);
+            throw new ServletException("Unable to compile servlet: " + name, ex);
         }
         removed = 0;
         return servletClass;

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.