DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦fb507645b⟧ Ada Source

    Length: 14336 (0x3800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package Errors, pragma Module_Name 4 3584, pragma Subsystem Design_Facility, seg_028ad8

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with Profile;
with Simple_Status;
package Errors is

    subtype Error_Kinds    is Simple_Status.Condition_Name;
    subtype Condition      is Simple_Status.Condition;
    subtype Error_Severity is Simple_Status.Condition_Class;

    -- A CONDITION should be used to return error information from
    -- procedure calls.  They are relatively large and should always
    -- be passed by mode IN OUT.
    --
    -- A CONDITION consists of an ERROR_KINDS and a message string.  The
    -- ERROR_KINDS indicates the type of error (if any) and how
    -- serious the error is (or if completion was successful).  The
    -- Message provides additional information about the error.  A
    -- CONDITION is self-initializing to severity Normal and an empty
    -- message.
    --
    -- By convention, the set of defined ERROR_KINDS in an application
    -- should be standardized so that error conditions can be tested
    -- programmatically.

    ----- Error_Severity Constants
    --
    Normal  : constant Error_Severity := Simple_Status.Normal;
    Warn    : constant Error_Severity := Simple_Status.Warning;
    Problem : constant Error_Severity := Simple_Status.Problem;
    Fatal   : constant Error_Severity := Simple_Status.Fatal;


    function Make (Error_Name : String;  
                   Severity   : Error_Severity) return Error_Kinds
        renames Simple_Status.Create_Condition_Name;
    --
    -- Useful for creating predefined ERROR_KINDS.
    --
    -- NOTE: The length of ERROR_NAME is limited to 63 characters.

    procedure Append_Condition (A_Condition : in out Condition;
                                Owner       :        String;
                                Error_Kind  :        Error_Kinds;
                                Message     :        String);

    procedure Set_Ok (A_Condition : in out Condition)
        renames Simple_Status.Initialize;

    procedure Set (A_Condition : in out Condition;
                   Error_Kind  :        Error_Kinds;
                   Message     :        String)  
        renames Simple_Status.Create_Condition;
    --
    -- Augment A_CONDITION with a new ERROR_KIND and MESSAGE.  The REPORT
    -- procedures declared below display the information most recently
    -- SET.  Use REPORT_CONDITION at the end of this package to display
    -- all information stored in a given CONDITION.



    function Kind (Of_Condition : Condition) return Error_Kinds
        renames Simple_Status.Error_Type;
    --
    -- Returns the current ERROR_KIND from OF_CONDITION.

    function Severity (Of_Condition : Condition) return Error_Severity
        renames Simple_Status.Severity;
    --
    -- Returns the current ERROR_SEVERITY from OF_CONDITION.


    function Info (From_Condition : Condition) return String;
    --
    -- Returns the most recently SET information contained in
    -- FROM_CONDITION formatted in a style suitable for use in
    -- generating log messages.  The format of this information
    -- is ...  ERROR_NAME & ", " & MESSAGE
    --
    -- When either of ERROR_NAME or MESSAGE are the empty string, the
    -- intervening delimiter is omitted.  In this description,
    -- ERROR_NAME refers to the value provided in the first parameter of
    -- MAKE, and MESSAGE refers to the value provided in the MESSAGE
    -- parameter of APPEND_CONDITION and SET.


    function Exception_Info return String;
    --
    -- Called in the context of an exception handler, returns
    -- descriptive information about the name of the exception
    -- and the location at which it was raised.


    function Is_Error (A_Condition : Condition;
                       Severity    : Error_Severity := Errors.Warn)  
                      return Boolean renames Simple_Status.Error;
    --
    -- Returns SEVERITY (A_CONDITION) >= SEVERITY.
    --  (e.g. IS_ERROR (NONE) => False;  IS_ERROR (OPEN_ERROR) => True)

    function Is_Equal (A_Condition : Condition;  
                       An_Error    : Error_Kinds) return Boolean
        renames Simple_Status.Equal;
    --
    -- Returns KIND (A_CONDITION) = AN_ERROR.
    --
    -- NOTE: The severity component of A_CONDITION does not
    --       participate in the comparison.


    ----------------------------------------------------------
    -- The following are utilities for logging error messages
    ----------------------------------------------------------
    subtype Log_Level is Profile.Msg_Kind;

    ----- Log_Level Constants
    --
    Auxiliary : constant Log_Level := Profile.Auxiliary_Msg;
    Debug     : constant Log_Level := Profile.Debug_Msg;
    Note      : constant Log_Level := Profile.Note_Msg;
    Positive  : constant Log_Level := Profile.Positive_Msg;
    Position  : constant Log_Level := Profile.Position_Msg;
    Negative  : constant Log_Level := Profile.Negative_Msg;
    Warning   : constant Log_Level := Profile.Warning_Msg;
    Error     : constant Log_Level := Profile.Error_Msg;
    Xception  : constant Log_Level := Profile.Exception_Msg;
    Sharp     : constant Log_Level := Profile.Sharp_Msg;
    At_Sign   : constant Log_Level := Profile.At_Msg;
    Dollar    : constant Log_Level := Profile.Dollar_Msg;


    procedure Report_Exception (Where, What : String;
                                Level : Log_Level := Errors.Error;
                                Dont_Log, In_Message_Window : Boolean := False);
    --
    -- To be called in the context of an exception handler to
    -- display EXCEPTION_INFO in addition to information normally
    -- generated by REPORT below.

    procedure Report (Where, What                 : String;
                      With_Condition              : Condition;
                      Level                       : Log_Level := Errors.Note;
                      Dont_Log, In_Message_Window : Boolean   := False);
    --
    -- Generates a message of the following format to the current log
    -- device ...  WHERE & "; " & WHAT & " (" & INFO (WITH_CONDITION) & ')'
    --
    -- When WHERE is the null string, the semicolon separator is omitted
    -- from the display.  When WITH_CONDITION contains good status, the
    -- parentheses and their contents are omitted from the display.

    procedure Report (Where, What                 : String;
                      Level                       : Log_Level := Errors.Note;
                      Dont_Log, In_Message_Window : Boolean   := False);
    --
    -- Generates a message of the following format to the current log
    -- device ...  WHERE & "; " & WHAT
    --
    -- When WHERE is the null string, the semicolon separator is omitted
    -- from the display.


    --------------------------------------------------------------
    -- The following are errors used within the Design Facility
    --------------------------------------------------------------
    None : constant Error_Kinds :=  
       Make ("NONE", Errors.Normal);

    Internal_Error      : constant Error_Kinds :=  
       Make ("INTERNAL_ERROR", Errors.Fatal);
    Unknown             : constant Error_Kinds :=  
       Make ("UNKNOWN", Errors.Fatal);
    Unhandled_Exception : constant Error_Kinds :=  
       Make ("UNHANDLED_EXCEPTION", Errors.Fatal);
    Unimplemented       : constant Error_Kinds :=  
       Make ("UNIMPLEMENTED", Errors.Fatal);

    Open_Error     : constant Error_Kinds :=  
       Make ("OPEN_ERROR", Errors.Problem);
    Create_Error   : constant Error_Kinds :=  
       Make ("CREATE_ERROR", Errors.Problem);
    Access_Error   : constant Error_Kinds :=  
       Make ("ACCESS_ERROR", Errors.Problem);
    Lock_Error     : constant Error_Kinds :=  
       Make ("LOCK_ERROR", Errors.Problem);
    Mapping_Error  : constant Error_Kinds :=  
       Make ("MAPPING_ERROR", Errors.Problem);
    Inconsistency  : constant Error_Kinds :=  
       Make ("INCONSISTENCY", Errors.Problem);
    Table_Overflow : constant Error_Kinds :=
       Make ("TABLE_OVERFLOW", Errors.Problem);

    Undefined : constant Error_Kinds :=  
       Make ("UNDEFINED", Errors.Warn);
    Obsolete  : constant Error_Kinds :=  
       Make ("OBSOLETE", Errors.Warn);

    Invalid_Options    : constant Error_Kinds :=  
       Make ("INVALID_OPTIONS", Errors.Fatal);
    Warnings_Generated : constant Error_Kinds :=  
       Make ("WARNINGS_GENERATED", Errors.Warn);

    procedure Report_Condition (Status : Condition);
    --
    -- Displays the accumulated information contained in STATUS.


    pragma Subsystem (Design_Facility, Closed);
    pragma Module_Name (4, 3584);
    pragma Bias_Key (27);

end Errors;

E3 Meta Data

    nblk1=d
    nid=0
    hdr6=1a
        [0x00] rec0=19 rec1=00 rec2=01 rec3=03e
        [0x01] rec0=01 rec1=00 rec2=0d rec3=004
        [0x02] rec0=18 rec1=00 rec2=02 rec3=018
        [0x03] rec0=00 rec1=00 rec2=0c rec3=00c
        [0x04] rec0=1a rec1=00 rec2=03 rec3=00e
        [0x05] rec0=17 rec1=00 rec2=04 rec3=000
        [0x06] rec0=18 rec1=00 rec2=05 rec3=03c
        [0x07] rec0=00 rec1=00 rec2=0b rec3=01c
        [0x08] rec0=15 rec1=00 rec2=06 rec3=024
        [0x09] rec0=00 rec1=00 rec2=0a rec3=01c
        [0x0a] rec0=15 rec1=00 rec2=07 rec3=010
        [0x0b] rec0=17 rec1=00 rec2=08 rec3=00a
        [0x0c] rec0=18 rec1=00 rec2=09 rec3=000
    tail 0x2172259ae83c24797d649 0x42a00088462065003