+
+\newcommand{\esup}{
+ This error shall lead to an error message and immediate program
+ termination or a warning message and program continuation.
+}
+
+\newcommand{\enosup}{
+ This error shall always lead to an error message and immediate
+ program termination.
+}
+
+\rd{err001}{Error types}{
+ The program shall react to several error conditions. Some error
+ conditions can be turned into warnings by program configuration,
+ see \req{cfg003} and \req{cfg004} for details.\\
+ The following distinguished error types shall exist:
+ \begin{itemize}
+ \item Input/output error:\\
+ Error occuring during read from the input file descriptor
+ or during write to an output file.\\
+ No recovery from this error is possible.
+ \enosup
+ \item Block integrity error:\\
+ Caused by failed check according to \req{chk001}.\\
+ \esup
+ \item Checksum error:\\
+ Caused by failed check according to \req{chk002}.\\
+ \esup
+ \item Unknown block type error:\\
+ Caused by failed check according to \req{chk003}.\\
+ \esup
+ \item Object integrity error:\\
+ Caused by failed check according to \req{chk004}.\\
+ \esup
+ \item Usage error:\\
+ Error caused by errors in the program configuration i.e. wrong
+ parameters or impossible combinations of parameters.\\
+ \enosup \\
+ Additionally, the help (\req{h001}) message is output.
+ \item Internal program error:\\
+ Error caused by internal program problems.\\
+ This error should never occur.\\
+ \enosup
+ \end{itemize}
+}
+
+\rd{err002}{Program exit codes}{
+ The application shall return several different exir codes to the
+ execution environment (i.e. the shell). On occurrence of any error,
+ the program shall terminate with the appropriate exit code.\\
+ Program runs with warnings shall return a special exit code.
+ \begin{table}[H]
+ \begin{center}
+ \begin{tabular}{|r|c|}
+ \hline
+ \multicolumn{1}{|c|}{\bf Exit condition} & \bf Return code\\
+ \hline
+ Successfull program completion & 0 \\
+ File open error & 1\\
+ Input/output error & 2\\
+ Block integrity error & 3\\
+ Checksum error & 4\\
+ Unknown block type error & 5\\
+ Object integrity error & 6\\
+ Usage error & 7\\
+ Success with warnings & 99 \\
+ Internal program error & 100 \\
+ \hline
+ \end{tabular}
+ \caption[Program Exit codes]{Exit codes}
+ \end{center}
+ \end{table}
+}
+
+\rd{err003}{Error and warning messages}{
+ Every warning or error case shall cause an appropriate error respective
+ warning message.\\
+ Error messages shall consinst of ''Error:'' and the error reason.\\
+ Warning messages shall consist of ''Warning:'' and a descriptive
+ text.\\
+ The following texts shall be used to form error and warning messages:
+ \begin{table}[H]
+ \begin{center}
+ \begin{tabular}{|l|l|}
+ \hline
+ \bf Error condition & \bf Descriptive text\\ \hline
+ File open error & Could not open $<$filename$>$ for reading/writing!\\
+ Input error & Could not read from $<$filename$>$!\\
+ Output error & Could not write to $<$filename$>$!\\
+ Block integrity error & Block integrity check failed!\\
+ Checksum error & Block checksum wrong!\\
+ Unknown block type & Unknown block type!\\
+ Object integrity & Object integrity check failed!\\
+ Usage error & $<$Specific message describing the problem$>$\\
+ \hline
+ \end{tabular}
+ \end{center}
+ \caption[Error and warning messages]{Messages}
+ \end{table}
+}
+
+\rd{err004}{Error message output}{
+ Any error messages shall be output to standard error.\\
+ There shall be no way to suppress error messages.
+}
+
+\rd{err005}{Warning message output}{
+ Any warning messages shall be output to standard error.\\
+ There shall be a possibility to suppress warning messages.
+}
+
+\rd{err006}{Informational messages}{
+ Any informational messages go to standard error.