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. Advertisements

  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. Advertisements

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:
    3
    Views:
    1,941
    Scott
    Jun 26, 2003
  2. Kerri
    Replies:
    2
    Views:
    13,402
    Kevin Spencer
    Oct 27, 2003
  3. Ola
    Replies:
    0
    Views:
    785
  4. Selen
    Replies:
    0
    Views:
    2,902
    Selen
    May 28, 2004
  5. Tedka
    Replies:
    2
    Views:
    2,961
    Mr. Dot Net
    Jul 19, 2004
  6. =?Utf-8?B?VmFs?=
    Replies:
    0
    Views:
    3,379
    =?Utf-8?B?VmFs?=
    Jun 8, 2005
  7. Lars-Erik Aabech
    Replies:
    7
    Views:
    79,209
    surferjoe
    May 19, 2009
  8. June Moore
    Replies:
    1
    Views:
    20,765
    Kannan Ekanath
    Sep 3, 2003
Loading...