Exemple #1
0
        /// <summary>
        /// Set the current exception.
        /// <para>
        /// When you have caught an exception that you would like to pass across language
        /// boundaries, call this method with the exception. Then, on the other side of
        /// the language boundary, call the Throw method, which will throw the exception in the other language.
        /// </para>
        /// </summary>
        /// <param name="exception">The exception.</param>
        public void Set(System.Exception exception)
        {
            Safir.Dob.Typesystem.Exception exc = exception as Safir.Dob.Typesystem.Exception;
            if (exc != null)
            {
                Set(exc);
                return;
            }

            Safir.Dob.Typesystem.FundamentalException fundExc = exception as Safir.Dob.Typesystem.FundamentalException;
            if (fundExc != null)
            {
                Set(fundExc);
                return;
            }
            Set(0,
                "Unknown (non-Dob) exception with name "
                + exception.GetType().FullName
                + "\n"
                + exception.Message);
        }
Exemple #2
0
 private void Set(Safir.Dob.Typesystem.FundamentalException exception)
 {
     Set(exception.GetTypeId(), exception.Message);
 }