printstacktrace Questions
4
Sometimes backtrace is enough to diagnose problem. But sometimes reason of crash is not obvious without knowledge what was passed to function.
Getting information what was passed to function that ...
Zoophilia asked 28/5, 2017 at 12:59
7
Solved
I have a regular C# code. I have no exceptions. I want to programmatically log the current stack trace for debugging purpose. Example:
public void executeMethod()
{
logStackTrace();
method();
}...
Granuloma asked 10/2, 2009 at 9:45
2
In my custom exception class I've overridden toString():
@Override
public String toString() {
final String msg = getLocalizedMessage();
// base
String str = getClass().getName() + ": [" + code...
Prelusive asked 13/4, 2011 at 14:45
7
Solved
In my application, I am running my code through PMD.It shows me this message:
Avoid printStackTrace(); use a logger call instead.
What does that mean?
Cartelize asked 7/5, 2012 at 6:23
6
Solved
I'm using Clojure and I want to get my hands on a stack trace that I can log (ideally, i would like to get it as a String).
I see that (.getStackTrace e) returns a StackTraceElement[] but I don't ...
Pressing asked 26/6, 2013 at 7:34
9
Solved
I am going through a socket program. In it, printStackTrace is called on the IOException object in the catch block.
What does printStackTrace() actually do?
catch(IOException ioe)
{
ioe.printStac...
Footpoundsecond asked 1/4, 2010 at 12:46
5
Solved
Why does NetBeans IDE raise a flag on printing a Java stack trace?
try {
//try to do something there
} catch (IOException e) {
//handle the exception
e.printStackTrace();
}
For some reason th...
Hypha asked 18/8, 2011 at 0:3
9
Solved
There is a lot of material out there which suggests that printing the stack trace of an exception is bad practice.
E.g. from the RegexpSingleline check in Checkstyle:
This check can be used [...] ...
Crore asked 19/9, 2011 at 10:12
1
In my junit 4 test code I am using test rules that contain code like this:
catch (Throwable t) {
t.printStackTrace();
throw t;
}
Findbugs complains about this, and rightfully so - this should ...
Marienthal asked 6/10, 2016 at 14:17
5
Solved
Is it a bad idea to use printStackTrace() in Android Exceptions like this?
} catch (Exception e) {
e.printStackTrace();
}
Ingres asked 4/10, 2010 at 12:26
8
Solved
How do I print the entire stack trace using java.util.Logger? (without annoying Netbeans).
The question should've originally specified staying within Java SE. Omitting that requirment was an error...
Tieshatieup asked 19/9, 2013 at 8:39
1
Solved
In my code snippet below, the printStackTrace() method is called in the catch block. After running the program you can see that sometimes the printStackTrace() runs several times in a row instead o...
Sapphirine asked 11/5, 2014 at 1:50
3
Solved
Any suggestions on how to, in a cross-browser way, generate a stack trace in javascript?
Newer browsers, Chrome and Firefox, expose a console object that allows stack traces to be generated....
Featherveined asked 20/11, 2012 at 19:23
3
I am writing some code which can generate Exceptions deep in the stack, and I have a layer nearer the top which catches these exceptions and sends them off for processing by an error handling modul...
Blairblaire asked 11/4, 2012 at 9:30
2
Solved
I have something similar to this.
void func() {
try {
//socket disconnects in middle of ..parsing packet..
} catch(Exception ex) {
if(!ex.getMessage().toString().equals("timeout") || !ex.getMe...
Cohla asked 22/8, 2010 at 18:10
3
When Exception happens you can print out the StackTrace and review it.
What if you want to get the StackTrace without an exception happening?
Is there a way to do this?
Cloninger asked 7/3, 2009 at 0:12
1
© 2022 - 2024 — McMap. All rights reserved.