smiths / caseStudies

Case studies of (manual) documentation for scientific computing software
3 stars 2 forks source link

FileError not Predefined #138

Closed samm82 closed 6 years ago

samm82 commented 6 years ago

Unless I'm misunderstanding this and you want errors to be raised by:

raise SystemExit("ValueError: TNT must be positive")

(as used in previous implementation) as opposed to:

raise ValueError("TNT must be positive")

the highlighted error should actually be a FileNotFoundError (and as a bonus would trigger without us explicitly raiseing it), as FileError is not a predefined exception.

fileError


If you want exceptions raised the old way, the exceptions listed should both be SystemExit.

smiths commented 6 years ago

The MIS is actually intended to be language agnostic. Sometimes this is relaxed to make life a bit easier, but we really should be able to generate any language code from the MIS. In some cases this means defining a mapping between the MIS and the specific language. For instance, renaming FileError. We don't need to change the error in the specification. Whatever equivalent name in the implementation language is fine.

We should be using ValueErrors, not SystemExit. I don't agree with the previous implementation on this. We want an error that can be trapped and handled. We haven't thought much about exception handling, but we want to leave the possibility open.

samm82 commented 6 years ago

Thanks for the clarification! This issue can be closed then.