Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id BBAAC200C84 for ; Mon, 15 May 2017 04:44:57 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B1DBB160BCC; Mon, 15 May 2017 02:44:57 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 00731160BB7 for ; Mon, 15 May 2017 04:44:56 +0200 (CEST) Received: (qmail 12055 invoked by uid 500); 15 May 2017 02:44:56 -0000 Mailing-List: contact users-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@groovy.apache.org Delivered-To: mailing list users@groovy.apache.org Received: (qmail 12045 invoked by uid 99); 15 May 2017 02:44:55 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 May 2017 02:44:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 52E46C0158 for ; Mon, 15 May 2017 02:44:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.379 X-Spam-Level: ** X-Spam-Status: No, score=2.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id yS7ZWl5C50Uq for ; Mon, 15 May 2017 02:44:51 +0000 (UTC) Received: from mail-it0-f41.google.com (mail-it0-f41.google.com [209.85.214.41]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 6F80D5F520 for ; Mon, 15 May 2017 02:44:50 +0000 (UTC) Received: by mail-it0-f41.google.com with SMTP id c15so35669854ith.0 for ; Sun, 14 May 2017 19:44:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=ruHBIjldIMbQD/gJn6chpprn9Po+/XtULKy2cyOISOY=; b=b52t4LymDTpQEFkW2B+xgVAdBayK4utAVMQpWs+POlbuLUQjAIL7gfbnQnJs0vDtX/ QIpSF35syyJbsyJqmqi81T7R5+vwcn/3xdx2OPF1KzYzu4KP2dwkeCPIN4oQYIw9i4UB 43wQN53EuMTl3bh0+8CkWaVJznaP/wfzHXDakfRi89hC89Gmzi13ehVRV/oqQvsD3WMv npPuH9o8Kgw+LecasfahYR2vUt+rewUjqLPXhYTX9JVeF2W3GXMQeorWQWrvUVC6zpzr TDPCQM/GFyMu76BQxc1eEJAlg3K27TU7qVuLpMrmQI7F0YwgjGKat78fUbNPKJ+JKcB8 pthg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ruHBIjldIMbQD/gJn6chpprn9Po+/XtULKy2cyOISOY=; b=R8ghutcRiZt4JuX9o2a49mHgXAnBYgv8WG+P2uV9oKMXSu6U63KB3FEc076jTj9Hji E/wH6zRo7JUT4e31/MONGsVx9gN6XK/ZVc+x4hHZp6eNQYcXgnKjIN8EEBGJZqLeFtJt SemrQvy6/Etv6fWG0/x01SKdTOWm2r1dQBMB5bs0i7khpkLc8NcG6b2VHMR44h1LsDuc 5rHXN1xOCESUICeQ9MZwvXgVEqEABSK0IAckPAT/gfFaexhw/xyF2mANhvy7rwnl90qD joqJn2OLTyjQGXu4QHXaRl/IZL7Y891bjgjSMzcsxyh9lCwSZXneGXUL8claiH+Hwp6S hssw== X-Gm-Message-State: AODbwcCYe6A5WxWbrkiRYNeR8Pl7l9hG4HoYUMLc2OYGsOFGsRmJ/uaT UGPiv6EXdvHdgza2aK6V8s3QQgIxrg== X-Received: by 10.36.104.72 with SMTP id v69mr3409240itb.27.1494816289202; Sun, 14 May 2017 19:44:49 -0700 (PDT) MIME-Version: 1.0 From: Chandler Lv Date: Mon, 15 May 2017 02:44:38 +0000 Message-ID: Subject: Cannot get line number through ScriptException To: "users@groovy.apache.org" Content-Type: multipart/alternative; boundary="001a11456592ec2944054f870959" archived-at: Mon, 15 May 2017 02:44:57 -0000 --001a11456592ec2944054f870959 Content-Type: text/plain; charset="UTF-8" Hi all, I use groovy in my java application. With JSR223, first compile, then eval. Everything is good except for one thing. It looks like that I cannot get the line number through catching ScriptException when there is something wrong with my scripts. So I checkout the source code. In GroovyScriptEngineImpl#eval(), ... } catch (Exception e) { throw new ScriptException(e); } finally { ... The constructor code is: public ScriptException(Exception e) { super(e); fileName = null; lineNumber = -1; columnNumber = -1; } So my question is, how to get the line number through ScriptException or any other way with JSR223 implementation. Thanks, zehui lv --001a11456592ec2944054f870959 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi all,

I use groovy in my j= ava application. With JSR223, first compile, then eval. Everything is good = except for one thing. It looks like that I cannot get the line number throu= gh catching ScriptException when there is something wrong with my scripts.<= /div>

So I checkout the source code. In GroovyScriptEngi= neImpl#eval(),=C2=A0

...
} catch (Except= ion e) {
=C2=A0 =C2=A0 =C2=A0 throw new ScriptException(e);
=
} finally {
...

The constructor cod= e is:
public ScriptException(Exception e) {
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 super(e);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 fileName = =3D null;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 lineNumber =3D -1;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 columnNumber =3D -1;
}
So my question is, how to get the line number through ScriptEx= ception or any other way with JSR223 implementation.

Thanks,
zehui lv
--001a11456592ec2944054f870959--