[ 
https://issues.apache.org/jira/browse/TINKERPOP-1459?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15510750#comment-15510750
 ] 

stephen mallette commented on TINKERPOP-1459:
---------------------------------------------

You can run from a file with `-e`:

{code}
$ bin/gremlin.sh -e x.groovy
Error in x.groovy at [1: 1/0] - Division by zero
java.lang.ArithmeticException: Division by zero
        at java.math.BigDecimal.divide(BigDecimal.java:1742)
        at 
org.codehaus.groovy.runtime.typehandling.BigDecimalMath.divideImpl(BigDecimalMath.java:68)
        at 
org.codehaus.groovy.runtime.typehandling.IntegerMath.divideImpl(IntegerMath.java:49)
        at 
org.codehaus.groovy.runtime.dgmimpl.NumberNumberDiv$NumberNumber.invoke(NumberNumberDiv.java:323)
        at 
org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
        at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
        at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
        at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
        at groovysh_evaluate.run(groovysh_evaluate:3)
        at 
org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
        at 
org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:70)
        at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:190)
        at 
org.apache.tinkerpop.gremlin.console.GremlinGroovysh.super$3$execute(GremlinGroovysh.groovy)
        at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at 
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
        at 
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:132)
        at 
org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:72)
        at 
org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
        at 
org.apache.tinkerpop.gremlin.console.Console.executeInShell(Console.groovy:373)
        at 
org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
        at 
org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:147)
        at 
org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
        at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:458)
{code}

I'd say that's preferred over `cat`. Not sure I'm following what you're looking 
to see changed though - do you want the console to ignore the error and keep 
executing the script? or just not show the stack trace at all? Could you please 
clarify?

> When executing lines from a file and encountering error, Gremlin console 
> should disable stack trace prompt
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: TINKERPOP-1459
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1459
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: console
>    Affects Versions: 3.2.2
>            Reporter: Xian Yi Teng
>
> {code}
> automaton@ip-10-200-156-87:~$ cat test.txt 
> 1/0
> 1+1
> 2+2
> 3+3
> automaton@ip-10-200-156-87:~$ cat test.txt | dse gremlin-console
>          \,,,/
>          (o o)
> -----oOOo-(3)-oOOo-----
> plugin activated: tinkerpop.tinkergraph
> plugin activated: tinkerpop.server
> plugin activated: tinkerpop.utilities
> gremlin> 1/0
> Division by zero
> Display stack trace? [yN] 1+1
> gremlin> automaton@ip-10-200-156-87:~$ 
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to