Exception.getMessage() returns null.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    Exception.getMessage() returns null.

    Please make me understand ... why Exception.getMe ssage() returns null.
    In which situation it happens, please explain me.

    Debasis Jana
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by dmjpro
    Please make me understand ... why Exception.getMe ssage() returns null.
    In which situation it happens, please explain me.

    Debasis Jana
    [code=java]
    new Exception();
    [/code]

    kind regards,

    Jos

    Comment

    • dmjpro
      Top Contributor
      • Jan 2007
      • 2476

      #3
      Originally posted by JosAH
      [code=java]
      new Exception();
      [/code]

      kind regards,

      Jos
      Actually my code is something like this ...

      [code=java]
      try
      {
      //some code
      }catch(Exceptio n e){
      //here e.getMessage() returns null
      }
      [/code]

      What should be the possibility?

      Debasis Jana

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by dmjpro
        What should be the possibility?
        Did you read my previous reply? If an Exception is created without passing it
        a String message the Exception will return null as its message.

        kind regards,

        Jos

        Comment

        Working...