Which Error for bad config files?

T

Trans

When loading a configuration file and it proves to be invalid in some
way, what class of error should be raised?

T.
 
J

James Britt

Trans said:
When loading a configuration file and it proves to be invalid in some
way, what class of error should be raised?

InvalidConfigurationFileError?

:)

I.e., isn't this a case where you want to create a semantically
meaningful Exception class?


James


--

http://www.ruby-doc.org - Ruby Help & Documentation
http://www.artima.com/rubycs/ - Ruby Code & Style: Writers wanted
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys
http://www.30secondrule.com - Building Better Tools
 
T

Trans

James said:
InvalidConfigurationFileError?

:)

I.e., isn't this a case where you want to create a semantically
meaningful Exception class?

Perhaps, but what I'm working on is really quite general. And even if I
need to create my own class I want to subclass the most appropriate
preexisting Error class.

T.
 
E

Eric Hodel

Perhaps, but what I'm working on is really quite general. And even
if I
need to create my own class I want to subclass the most appropriate
preexisting Error class.

RuntimeError then.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,189
Messages
2,571,016
Members
47,616
Latest member
gijoji4272

Latest Threads

Top