Thread: To: people who post exceptions and expect help

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 To: people who post exceptions and expect help 
    Registered Member Killer 99's Avatar
    Join Date
    Dec 2007
    Posts
    1,484
    Thanks given
    171
    Thanks received
    503
    Rep Power
    414
    For the most part if you give someone an exception (a stack trace) they will not be able to help you!

    Why? because the stack trace only contains information about where it occurred (the stack) and sometimes line numbers if they were included in the class file(s). This means that in order to figure out why it actually had an exception, you need the source code!

    Well sometimes you don't wanna give you your entire source code right? (I wouldn't either, and no one wants the whole things, or maybe they do?)

    Just identify the portions of code (single lines or the method in which it occurred in) and share that with whoever you want help from.


    Wait, why do I need help from others? Most of the time you don't.

    Here is my very straightforward explanation of stack traces (exceptions), more detailed information: Java Tip 124: Trace your steps in Java 1.4 - JavaWorld

    OK so here is a stack trace ("exception"), I also advise when posting them use code tags it makes it easier to read

    Code:
    java.lang.Throwable
            at boo.hoo.StackTrace.bar(StackTrace.java:223)
            at boo.hoo.StackTrace.foo(StackTrace.java:218)
            at boo.hoo.StackTrace.main(StackTrace.java:54)
    What this tells us:

    The type of exception is: java.lang.Throwable (the highest level exception/error, every exception is an instanceof Throwable)

    Where the exception was thrown/occurred: Class boo.hoo.StackTrace in method bar at line 223

    Now if you want to know what called the function that it occurred in you can do the above step with the next line, so on...

    Sometimes you will have things like

    Code:
    java.lang.Throwable: Failed to load files
            at boo.hoo.StackTrace.bar(StackTrace.java:223)
            at boo.hoo.StackTrace.foo(StackTrace.java:218)
            at boo.hoo.StackTrace.main(StackTrace.java:54)
    We can see here the reason for this exception is "Failed to load files." Now not all exceptions will have these, but it can be very helpful so when you are throwing exceptions in you own application it is nice to have the descriptions.

    New to line numbers? Most editors will have the hot-key: Ctrl+G, just enter your line number and press enter!

    Thanks!

    -Joe

    P.S: I would like this in all coding related sections, just because it's important to know for beginners, but I'd rather not get banned lol
    Reply With Quote  
     


  2. #2  
    Apocalyptism
    Harry's Avatar
    Join Date
    Apr 2007
    Posts
    3,783
    Thanks given
    594
    Thanks received
    1,833
    Rep Power
    2934
    I think the most annoying thing is when people send you exceptions asking you to tell them what's causing it, when the stack trace blatantly already states what's wrong.
    ~ Harry
    Please bear this in mind when hearing the word 'soon' from a software programmer.

    As coding software generally takes thousands of years, software programmers have developed a natural adaptation to this in the form of an altered perception of the flow of time.

    Due to this, the word 'soon' when uttered by a programmer should be taken to mean 'a very, very long time from now' in the terminology used by common human specimens who have not developed such an adaptation.
    knowledge can be taught, but passion cannot.
    It's better to create something that others criticise than to create nothing and criticise others.
    Reply With Quote  
     


  3. #3  
    God
    God is offline
    #packeting

    God's Avatar
    Join Date
    Feb 2011
    Posts
    1,007
    Thanks given
    315
    Thanks received
    115
    Rep Power
    181
    Some people don't even read what it is printing out regardless, witch most of the time all the information is there, oh kids these days..

    Nice though hope this helps




    LOL^

    [Today 12:51 AM] Stewie: If at first you don't succeed, you probably just realized you're a woman.

    ...oh stewie
    Reply With Quote  
     

  4. #4  
    Donator


    Join Date
    Mar 2011
    Posts
    2,358
    Thanks given
    1,193
    Thanks received
    824
    Rep Power
    856
    Glad I'm not the only one who hates it when people do that. Good job
    Reply With Quote  
     

  5. #5  




    Scu11's Avatar
    Join Date
    Aug 2007
    Age
    27
    Posts
    16,224
    Thanks given
    7,202
    Thanks received
    12,242
    Discord
    View profile
    Rep Power
    5000
    Moved to help & stickied.





    Reply With Quote  
     

  6. Thankful users:


  7. #6  
    Registered Member
    Join Date
    Jan 2012
    Posts
    62
    Thanks given
    0
    Thanks received
    3
    Rep Power
    11
    Thankyou for this This has been a good help.
    Reply With Quote  
     

  8. #7  
    Banned

    Join Date
    Jul 2008
    Posts
    3,531
    Thanks given
    188
    Thanks received
    696
    Rep Power
    0
    it sucks that the majority of the kids wont even read this so the problem will continue

    kudos for effort
    Reply With Quote  
     

  9. Thankful users:


  10. #8  
    fumant viriditas quotidiana

    saifix's Avatar
    Join Date
    Feb 2009
    Age
    27
    Posts
    1,239
    Thanks given
    277
    Thanks received
    956
    Discord
    View profile
    Rep Power
    3304
    rep+= gd thread m8
    "Im so bluezd out of my box.
    Im so fkd i canr even sens makeas Smoke blunt 420hash e tizday" - A legendary guy (1993 - 2015)
    Quote Originally Posted by nmopal View Post
    I will be creating a grimy dubstep song using these lyrics and vocaloid please prepare your bodies
    Reply With Quote  
     

  11. #9  
    Fuckin PRO Derek's Avatar
    Join Date
    May 2008
    Posts
    1,257
    Thanks given
    38
    Thanks received
    86
    Rep Power
    67
    Good job, hopefully this clears up this section a little bit. I learned from this as well.
    Reply With Quote  
     

  12. #10  
    Registered Member
    Join Date
    Jun 2012
    Posts
    175
    Thanks given
    32
    Thanks received
    47
    Rep Power
    35
    Here's a good resource. It has a list of Java exceptions and what they mean.

    List of Java Exception
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Confusing Exceptions
    By Soulevoker in forum Help
    Replies: 3
    Last Post: 05-10-2010, 11:02 PM
  2. Two exceptions - repost.
    By baghori1 in forum Help
    Replies: 0
    Last Post: 01-20-2009, 01:06 AM
  3. Two exceptions, need help.
    By baghori1 in forum Help
    Replies: 2
    Last Post: 01-19-2009, 06:53 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •