|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 8192 (0x2000)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, generic, package Errors, seg_02b9fc
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦this⟧
-- This package provides a mechanism for writing commands which
-- perform error reporting and error handling in a manner consistent
-- with Environment commands.
--
-- NOTE: This package has internal state, so it cannot be used safely
-- multi-tasking applications.
--
with Profile;
generic
Old_Response_Profile : Profile.Response_Profile;
--
-- Is the response profile to which the response profile should
-- be reset when exiting.
New_Response_Profile : Profile.Response_Profile;
--
-- Is the response profile which should be used to evaluate log
-- output destination, error reaction, etc.
Operation_Name : in String;
--
-- Specifies the name of the operation to be used in the closing
-- message (i.e. "[end of <Operation_Name>--error(s) detected]").
Parameter_List : in String;
--
-- Should be a list of the parameters supplied to the operation,
-- of the form:
--
-- First_Parameter => Some_Value, Second_Parameter => Another_Value, etc
--
-- String values should be quoted:
--
-- String_Parameter => ""Some_String""
package Errors is
procedure Prologue;
--
-- Sets the response profile to the new response profile, and then
-- writes an auxiliary message of the form:
--
-- [<Operation_Name> (<Parameter_List>);]
--
-- Should be the first thing called in any program.
procedure Epilogue;
--
-- If there were no errors, writes an auxiliary message of the form:
--
-- [end of <Operation_Name> operation--no errors detected]
--
-- If there were errors (non-fatal ones), writes an auxiliary message of
-- the form
--
-- [end of <Operation_Name> operation--error(s) detected]
--
-- In both cases, resets the response profile to the original response
-- profile.
Propagate : exception;
Quit : exception;
Nil_Message : constant String := "";
procedure Report (This_Message : in String;
This_Type : in Profile.Msg_Kind := Profile.Error_Msg;
Fatal : in Boolean := True;
Nested : in Boolean := False;
Suppress_Closing_Message : in Boolean := False);
--
-- Does a "Log.Put_Line" of the specified message to the appropriate
-- output. Message will be of the specified kind (if the message is
-- equal to Nil_Message, nothing will be output, but the error reaction
-- will still work as described below).
--
-- Once the message is written:
--
-- If the error reaction is "QUIT":
--
-- A closing message is written (unless "Suppress_Closing_Message" is
-- True), and the response profile is reset to
-- "Original_Response_Profile". Then:
--
-- If "Nested" is True, "Quit" is raised.
--
-- If the error reaction is "PROPAGATE":
--
-- A closing message is written (unless "Suppress_Closing_Message" is
-- True), the response profile is reset to "Original_Response_Profile",
-- and "Propagate" is raised.
--
-- If the error reaction is "PERSEVERE":
--
-- If "Fatal" is True:
--
-- A closing message is written (unless "Suppress_Closing_Message" is
-- True), and the response profile is reset to
-- "Original_Response_Profile". Then:
--
-- If "Nested" is True, "Quit" is raised.
--
-- If the error reaction is "RAISE_ERROR":
--
-- If "Fatal" is True:
--
-- A closing message is written (unless "Suppress_Closing_Message" is
-- True), the response profile is reset to
-- "Original_Response_Profile", and "Propagate" is raised.
--
-- For this procedure to work correctly, two conditions must be
-- satisfied in the client:
--
-- 1) The client must provide the following exception handler alternatives
-- at the outermost lexical level:
--
-- when Errors.Propagate =>
-- raise;
-- when Errors.Quit =>
-- null;
--
-- 2) Every raise of "Propagate" and "Quit" by every call to "Report"
-- must be able to get to the above exception handler alternatives.
-- Here is an example template of how this package should be used:
-- with Log;
-- with Errors;
-- with Profile;
-- with Debug_Tools;
-- with <others>;
-- procedure Template (This_Parameter : in String := "<SPECIAL_NAME>";
-- That_Parameter : in String := ">> PLACEHOLDER <<";
-- Another_Parameter : in Boolean := True;
-- Response : in String := "<PROFILE>") is
--
-- package Error is
-- new Errors
-- (Profile.Get,
-- Profile.Value (Response),
-- "Template",
-- "This_Parameter => """ & This_Parameter &
-- """, That_Parameter => """ & That_Parameter &
-- """, Another_Parameter => " &
-- Boolean'Image (Another_Parameter) &
-- ", Response => """ & Response & """");
--
-- <other declarations>;
--
-- begin
-- Error.Prologue;
-- loop
-- begin
-- Call_Some_Other_Procedure ("PROPAGATE," & Response);
-- --
-- exception
-- when others =>
-- Error.Report ("<message for call failure>",
-- -- IF CALL FAILURE IS NOT FATAL:
-- Fatal => False,
-- Nested => True);
-- end;
-- end loop;
-- Error.Epilogue;
-- --
-- exception
-- when This_Exception =>
-- Error.Report ("<message for this exception>");
-- when That_Exception =>
-- Error.Report ("<message for different exception>");
-- when Error.Propagate =>
-- raise;
-- when Error.Quit =>
-- null;
-- when others =>
-- Error.Report ("EXCEPTION: " & Debug_Tools.Get_Exception_Name,
-- Profile.Exception_Msg);
-- end Template;
--
-- *****
--
-- NOTE: This procedure should NOT be used to report progress messages,
-- warnings, and other non-errors.
end Errors;
nblk1=7
nid=0
hdr6=e
[0x00] rec0=20 rec1=00 rec2=01 rec3=016
[0x01] rec0=20 rec1=00 rec2=02 rec3=022
[0x02] rec0=19 rec1=00 rec2=03 rec3=016
[0x03] rec0=19 rec1=00 rec2=04 rec3=01c
[0x04] rec0=1b rec1=00 rec2=05 rec3=016
[0x05] rec0=19 rec1=00 rec2=06 rec3=006
[0x06] rec0=16 rec1=00 rec2=07 rec3=000
tail 0x21724803283f078ac6ca4 0x42a00088462060003