BadData exception

Discussion in 'Java' started by Roedy Green, Oct 24, 2003.

  1. Roedy Green

    Roedy Green Guest

    If you did not roll your own specific exception, what flavour of
    exception should you throw to indicate data in a file are not up to
    snuff, e.g. invalid value, missing tag, unbalanced delimiters etc.?

    Is IllegalArgumentException the best you can do?

    Would it be reasonable to treat them as a species of IOException?

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Oct 24, 2003
    #1
    1. Advertising

  2. Roedy Green

    Sudsy Guest

    Roedy Green wrote:
    > If you did not roll your own specific exception, what flavour of
    > exception should you throw to indicate data in a file are not up to
    > snuff, e.g. invalid value, missing tag, unbalanced delimiters etc.?
    >
    > Is IllegalArgumentException the best you can do?
    >
    > Would it be reasonable to treat them as a species of IOException?


    Considering that UTFDataFormatException extends IOException,
    it would appear that others agree with your approach.
     
    Sudsy, Oct 25, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jeff
    Replies:
    0
    Views:
    1,546
  2. jeff
    Replies:
    3
    Views:
    1,714
    Scott
    Jun 26, 2003
  3. Kerri
    Replies:
    2
    Views:
    13,086
    Kevin Spencer
    Oct 27, 2003
  4. Ola
    Replies:
    0
    Views:
    552
  5. Selen
    Replies:
    0
    Views:
    2,707
    Selen
    May 28, 2004
Loading...

Share This Page