groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pascalschumac...@apache.org
Subject incubator-groovy git commit: GROOVY-7586: Groovysh: print Exception class for normal Exceptions (closes #116)
Date Tue, 08 Sep 2015 18:12:36 GMT
Repository: incubator-groovy
Updated Branches:
  refs/heads/master 37c1103ad -> a16ab5d86


GROOVY-7586: Groovysh: print Exception class for normal Exceptions (closes #116)


Project: http://git-wip-us.apache.org/repos/asf/incubator-groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-groovy/commit/a16ab5d8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-groovy/tree/a16ab5d8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-groovy/diff/a16ab5d8

Branch: refs/heads/master
Commit: a16ab5d86dfc659df68236b0a0ff61cfb90bd52d
Parents: 37c1103
Author: Thibault Kruse <thibault.kruse@gmx.de>
Authored: Tue Sep 8 17:24:07 2015 +0200
Committer: pascalschumacher <pascalschumacher@gmx.net>
Committed: Tue Sep 8 20:12:06 2015 +0200

----------------------------------------------------------------------
 .../main/groovy/org/codehaus/groovy/tools/shell/Groovysh.groovy    | 2 +-
 .../groovy/org/codehaus/groovy/tools/shell/GroovyshTest.groovy     | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/a16ab5d8/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/Groovysh.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/Groovysh.groovy
b/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/Groovysh.groovy
index 7bd7c02..316b4a3 100644
--- a/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/Groovysh.groovy
+++ b/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/Groovysh.groovy
@@ -461,7 +461,7 @@ try {$COLLECTED_BOUND_VARS_MAP_VARNAME[\"$varname\"] = $varname;
     final Closure defaultErrorHook = { Throwable cause ->
         assert cause != null
 
-        if (log.debug || ! cause instanceof CompilationFailedException) {
+        if (log.debug || ! (cause instanceof CompilationFailedException)) {
             // For CompilationErrors, the Exception Class is usually not useful to the user
             io.err.println("@|bold,red ERROR|@ ${cause.getClass().name}:")
         }

http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/a16ab5d8/subprojects/groovy-groovysh/src/test/groovy/org/codehaus/groovy/tools/shell/GroovyshTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-groovysh/src/test/groovy/org/codehaus/groovy/tools/shell/GroovyshTest.groovy
b/subprojects/groovy-groovysh/src/test/groovy/org/codehaus/groovy/tools/shell/GroovyshTest.groovy
index d497aec..a8bd4de 100644
--- a/subprojects/groovy-groovysh/src/test/groovy/org/codehaus/groovy/tools/shell/GroovyshTest.groovy
+++ b/subprojects/groovy-groovysh/src/test/groovy/org/codehaus/groovy/tools/shell/GroovyshTest.groovy
@@ -112,6 +112,8 @@ class GroovyshTest extends GroovyTestCase {
                     new StackTraceElement(Interpreter.SCRIPT_FILENAME, 'run', 'scriptFile',
42)]
         })
         assert '' == mockOut.toString()
+        assert mockErr.toString().contains('org.codehaus.groovy.tools.shell.GroovyshTest$1')
+        assert mockErr.toString().contains('fooClass')
         assert mockErr.toString().contains('foo')
         assert ! mockErr.toString().contains(Interpreter.SCRIPT_FILENAME)
         assert ! mockErr.toString().contains('...')


Mime
View raw message