From dac2f29e5e485c13446abd089e446dff05329d0d Mon Sep 17 00:00:00 2001 From: "Flavio S. Glock" Date: Sat, 13 May 2017 17:31:08 +0200 Subject: [PATCH] Perlito5 - cpan - prepare v9.022 - cleanup debugging code --- perlito5.pl | 28 +++++++++++++++++--------- src5/lib/Perlito5/Java/JavaCompiler.pm | 28 +++++++++++++++++--------- 2 files changed, 36 insertions(+), 20 deletions(-) diff --git a/perlito5.pl b/perlito5.pl index 617dd440b..241dca9cb 100644 --- a/perlito5.pl +++ b/perlito5.pl @@ -22260,7 +22260,7 @@ throw(e); } catch(Exception e) { - e.printStackTrace(); + // e.printStackTrace(); String message = e.getMessage(); // System.out.println("Exception in eval_string: " + message); PlV.sset("main::@", new PlString(message)); @@ -22306,7 +22306,7 @@ // System.out.println("eval_string: constants \\n[[[ " + constants + " ]]"); } catch(Exception e) { - e.printStackTrace(); + // e.printStackTrace(); String message = e.getMessage(); // System.out.println("Exception in eval_string: " + message); PlV.sset("main::@", new PlString(message)); @@ -22355,13 +22355,21 @@ source5.append(" catch(PlReturnException e) {\\n"); source5.append(" return e.ret;\\n"); source5.append(" }\\n"); - - // TODO - get error details before returning - // source5.append(" catch(Exception e) {\\n"); - // source5.append(" e.printStackTrace();\\n"); - // source5.append(" throw(e);\\n"); - // source5.append(" }\\n"); - + source5.append(" catch(PlNextException e) {\\n"); + source5.append(" throw(e);\\n"); + source5.append(" }\\n"); + source5.append(" catch(PlLastException e) {\\n"); + source5.append(" throw(e);\\n"); + source5.append(" }\\n"); + source5.append(" catch(PlRedoException e) {\\n"); + source5.append(" throw(e);\\n"); + source5.append(" }\\n"); + source5.append(" catch(Exception e) {\\n"); + source5.append(" e.printStackTrace();\\n"); + source5.append(" String message = e.getMessage();\\n"); + source5.append(" PlV.sset(\\"main::@\\", new PlString(message));\\n"); + source5.append(" return PerlOp.context(want);\\n"); + source5.append(" }\\n"); source5.append(" }\\n"); source5.append("}\\n"); String cls5 = source5.toString(); @@ -22390,7 +22398,7 @@ throw(e); } catch(Exception e) { - e.printStackTrace(); + // e.printStackTrace(); String message = e.getMessage(); // System.out.println("Exception in eval_string: " + message); PlV.sset("main::@", new PlString(message)); diff --git a/src5/lib/Perlito5/Java/JavaCompiler.pm b/src5/lib/Perlito5/Java/JavaCompiler.pm index aa972731b..323cfda76 100644 --- a/src5/lib/Perlito5/Java/JavaCompiler.pm +++ b/src5/lib/Perlito5/Java/JavaCompiler.pm @@ -134,7 +134,7 @@ class PlJavaCompiler { throw(e); } catch(Exception e) { - e.printStackTrace(); + // e.printStackTrace(); String message = e.getMessage(); // System.out.println("Exception in eval_string: " + message); PlV.sset("main::@", new PlString(message)); @@ -180,7 +180,7 @@ class PlJavaCompiler { // System.out.println("eval_string: constants \n[[[ " + constants + " ]]"); } catch(Exception e) { - e.printStackTrace(); + // e.printStackTrace(); String message = e.getMessage(); // System.out.println("Exception in eval_string: " + message); PlV.sset("main::@", new PlString(message)); @@ -229,13 +229,21 @@ class PlJavaCompiler { source5.append(" catch(PlReturnException e) {\n"); source5.append(" return e.ret;\n"); source5.append(" }\n"); - - // TODO - get error details before returning - // source5.append(" catch(Exception e) {\n"); - // source5.append(" e.printStackTrace();\n"); - // source5.append(" throw(e);\n"); - // source5.append(" }\n"); - + source5.append(" catch(PlNextException e) {\n"); + source5.append(" throw(e);\n"); + source5.append(" }\n"); + source5.append(" catch(PlLastException e) {\n"); + source5.append(" throw(e);\n"); + source5.append(" }\n"); + source5.append(" catch(PlRedoException e) {\n"); + source5.append(" throw(e);\n"); + source5.append(" }\n"); + source5.append(" catch(Exception e) {\n"); + source5.append(" e.printStackTrace();\n"); + source5.append(" String message = e.getMessage();\n"); + source5.append(" PlV.sset(\"main::@\", new PlString(message));\n"); + source5.append(" return PerlOp.context(want);\n"); + source5.append(" }\n"); source5.append(" }\n"); source5.append("}\n"); String cls5 = source5.toString(); @@ -264,7 +272,7 @@ class PlJavaCompiler { throw(e); } catch(Exception e) { - e.printStackTrace(); + // e.printStackTrace(); String message = e.getMessage(); // System.out.println("Exception in eval_string: " + message); PlV.sset("main::@", new PlString(message));