1

I want to get Throwable.getStackTrace() result as a value in Ceylon. Java interface has printStackTrace method with parameter PrintWriter, but Ceylon Throwable interface has not. How can i get it?

asked Feb 17, 2015 at 20:14
2
  • It's not clear what you mean by converting the stack trace to a value. If my answer isn't what you're looking for, please clarify your question and let me know. Commented Feb 17, 2015 at 23:35
  • Your answer is ok. I didn't know the top-level function about it. Commented Feb 18, 2015 at 13:10

2 Answers 2

2

Similar to java.lang.Throwable.printStackTrace(PrintWriter), Ceylon's language module has the top-level function void printStackTrace(Throwable, Anything(String)). You provide the exception and a function which accepts a String.

answered Feb 17, 2015 at 23:33
Sign up to request clarification or add additional context in comments.

Comments

1

There's no true equivalent of Java's Throwable.getStackTrace() in the Ceylon language module because we wouldn't be able to implement that operation in JavaScript.

Therefore, I've just added the javaStackTrace() function to the module ceylon.interop.java, and that will be available in the 1.2 release of the platform.

(As already answered by @gdejohn, there's also the printStackTrace() function in ceylon.language.)

answered Jul 26, 2015 at 17:52

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.